- UID
- 5043
- 积分
- 1347
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-5-13
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- //*************************************************************
- //利用射线法判断一点是否在窗口内,如果在内部返回1,否则返回0
- //其中输入参数pt是被判断点,boundarypt是辅助边界点,用于作射线用
- //*********************1-14-2001 by Meishuli
- int inwindow(ads_point pt,ads_point boundarypt,ads_name windowent)
- {
- ads_name ent0;
- int rt;
- AcDbEntity *pent,*pwindowent;
- AcDbObjectId pentId,pwindowentId;
- AcGePoint3dArray points;
- int CrossPtsNum;
- AcGePoint3d Pts,BoundaryPts;
- AcDbObjectId auxlineId;
- Acad::ErrorStatus es;
- Pts.set(pt[X],pt[Y],0);
- BoundaryPts.set(boundarypt[X],boundarypt[Y],0);
- auxlineId=createLine(Pts,BoundaryPts);
- acdbEntLast(ent0);
- pwindowent=selectEntity(pwindowentId,windowent,AcDb::kForRead);
- pent=selectEntity(pentId,ent0,AcDb::kForRead);
- es=pwindowent->intersectWith(pent,AcDb::kOnBothOperands,points,0,0);
- if (es == Acad::eOk) {
- CrossPtsNum=points.length(); //计算交点的数量CrossPtsNum
- points.setLogicalLength(0);
- }
- else {
- acutPrintf("\nerror!--inwindow()\n");
- pent->close();
- acdbEntDel(ent0);
- pwindowent->close();
- return -1;
- }
- pent->close();
- acdbEntDel(ent0);
- pwindowent->close();
- if(CrossPtsNum % 2 == 0)
- rt = 0;
- else rt = 1;
- return rt;
- }
|
|