I have a line collection(contains many line) and a PathsD(with some polylines),
I need to pick out the the lines that intersects the PathD:
int nLen = m_pPts->size();
double dPtX, dPtY;
for (int i = 0; i < nLen; i++)
{
dPtX = m_pPts->at(i).x;
dPtY = m_pPts->at(i).y;
PathD lineClip;
lineClip.push_back(PointD(centerX, centerY));
lineClip.push_back(PointD(dPtX, dPtY));
PathsD clip, solutionClosed, solutionOpen;
clip.push_back(lineClip);
ClipperD clipperD;
clipperD.AddOpenSubject(clip);
clipperD.AddClip(*m_pFaultages);
clipperD.Execute(ClipType::Intersection, FillRule::NonZero, solutionClosed, solutionOpen);
//
if (solutionOpen.size() > 0) {
continue;
}
ptsInrange.push_back(m_pPts->at(i));
}
It runs very inefficiently, What is the right way?
I have a line collection(contains many line) and a PathsD(with some polylines),
I need to pick out the the lines that intersects the PathD:
int nLen = m_pPts->size();
double dPtX, dPtY;
for (int i = 0; i < nLen; i++)
{
dPtX = m_pPts->at(i).x;
dPtY = m_pPts->at(i).y;
PathD lineClip;
lineClip.push_back(PointD(centerX, centerY));
lineClip.push_back(PointD(dPtX, dPtY));
It runs very inefficiently, What is the right way?