- 积分
- 449
- 明经币
- 个
- 注册时间
- 2002-11-11
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2003-11-27 11:16:00
|
显示全部楼层
BOOL ifPointinPolyline(ads_point point, AcDbPolyline *pPl)
{
AcDbPolyline * pPline=pPl;
AcGePoint3d point3d;
point3d[X]=point[X];
point3d[Y]=point[Y];
point3d[Z]=point[Z];
AcDbRay *pRay = new AcDbRay();
pRay->setBasePoint(point3d);
pRay->setUnitDir(AcGeVector3d(1,0,0));
AcGePoint3dArray pts;
pts.setLogicalLength(0);
//用过线段起点的射线与图框求交
Acad::ErrorStatus es = pRay->intersectWith
(pPline,AcDb::kOnBothOperands,pts);
if(es!=Acad::eOk){
delete pRay;
return 0;
}
Adesk::Boolean bSt = Adesk::kTrue,bEd = Adesk::kTrue;
//如果交点数为ji数,说明点在图框内部
if(pts.length()%2!=0){
delete pRay;
return 1;
}
delete pRay;
return 0;
} |
|