ARX 查找多段线上的下一点

来源:互联网 发布:中国邮政网络 客户端 编辑:程序博客网 时间:2024/05/29 08:17
static void GetNextPt(const AcDbPolyline* plMin,const bool& gotonext,const int& plIndex,AcGePoint2d& ptNextS,AcGePoint2d& ptNextE){int nextIndex = 0;int count = plMin->numVerts();if(!gotonext){if(plIndex > 0){nextIndex = plIndex - 1;}else{nextIndex = count - 1;}}else{if(plIndex < count - 1){nextIndex = plIndex + 1;}else{nextIndex = 0;}}AcDbPolyline::SegType nextType = plMin->segType(nextIndex);if(nextType == AcDbPolyline::SegType::kArc){AcGeCircArc2d arc2d;plMin->getArcSegAt(nextIndex,arc2d);ptNextS = arc2d.startPoint();ptNextE = arc2d.endPoint();}else{AcGeLineSeg2d line2d;plMin->getLineSegAt(nextIndex,line2d);ptNextS = line2d.startPoint();ptNextE = line2d.endPoint();}}


原创粉丝点击