IntersectWith () функция имеет две формы:
virtual Acad::ErrorStatus
intersectWith(
const AcDbEntity* ent,
AcDb::Intersect intType,
AcGePoint3dArray& points,
int thisGsMarker = 0,
int otherGsMarker = 0) const;
virtual Acad::ErrorStatus
intersectWith(
const AcDbEntity* ent,
AcDb::Intersect intType,
const AcGePlane& projPlane,
AcGePoint3dArray& points,
int thisGsMarker = 0,
int otherGsMarker = 0) const;
Первая форма intersectWith () функциональные испытания на простое пересечение двух объектов. Вторая форма вычисляет пересечение на проекционную плоскость. Однако, обе функции возвращают перекрестные пункты{*точки*} на объекте непосредственно.
Использовать проекционную плоскую форму intersectWith () функция
1 Проектируют ваш объект и объект параметра на плоскость.
2 Проверяют объекты на пересечение на проекционной плоскости.
3 Проектируют перекрестные пункты{*точки*} назад на объект и возвращают их.
Заказной AsdkPoly класс перегружает обеих формы intersectWith () функция.
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 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, 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())) {