13 ppPts =
new DPoint*[nNewPolys]();
14 counts =
new long[nNewPolys]();
25 for (
int n = 0; n < nPolys; n++)
41 ppPts =
new DPoint*[a.nPolys]();
42 counts =
new long[a.nPolys]();
44 for (
int n = 0; n < nPolys; n++)
46 counts[n-1] = a.counts[n-1];
47 ppPts[n-1] =
new DPoint[a.counts[n-1]];
49 for (
int i = 0; i < a.counts[n-1]; i++)
50 a.ppPts[n-1][i] = a.ppPts[n-1][i];
58 DPoint** newPPts =
new DPoint*[nPolys+1];
59 long* newCounts =
new long[nPolys+1];
63 for (i = 0; i < nPolys; i++)
65 newPPts[i] = ppPts[i];
66 newCounts[i] = counts[i];
76 ppPts[i] =
new DPoint[nPts];
77 for (
long j = 0; j < nPts; j++)
87 long AddPts(
long subPoly, DPoint* pts,
long nPts)
89 if (subPoly < 0 || subPoly > nPolys)
93 DPoint* newPts = NULL;
94 try { newPts =
new DPoint[counts[subPoly-1] + nPts]; }
95 catch(...){
return 0; }
99 for (; i < counts[subPoly-1]; i++)
100 newPts[i] = ppPts[subPoly-1][i];
102 delete[] ppPts[subPoly-1];
105 ppPts[subPoly-1] = newPts;
107 for (
int j = 0; j < nPts; j++)
108 newPts[i++] = pts[j];
109 counts[subPoly-1] += nPts;
112 return counts[subPoly-1];
PolyPolylineData – poly-polyline data container class.
Definition: PolyPolylineData.h:6
long AddPts(long subPoly, DPoint *pts, long nPts)
add points to a subpath
Definition: PolyPolylineData.h:87
long AddSubPoly(DPoint *pts, long nPts)
add subpath
Definition: PolyPolylineData.h:55