Following are several examples of how pipImportInsert
is used.
Example 1
If you wanted to add a point, the parameters may be set as follows:
pipObjectInfoStruct pInfo;
/* Define the members of pInfo structure */
pInfo.type = PIP_POINT; pInfo.xCenter = -105245995;
pInfo.yCenter = 40030084; strcpy( pInfo.name, "Store 110");
/* The points, pointsPerPoly, nPolys may be NULL, NULL and 0, respectively, as they are ignored.
Now call pipImportInsert ...*/ pipImportInsert( impH, &pInfo, NULL, NULL, 0
);
Example 2
If you wanted to add a line that contains a chain with three points, the parameters may be set as:
pipObjectInfoStruct pInfo; intl points[6];
intl nPolys;
intl pointsPerPoly[1];
/* Define the members of pInfo structure */ pInfo.type = PIP_LINE;
strcpy( pInfo.name, "My Road");
/* These array entries form a line at 1,1 and 3,2, and 4,3 */
points[0] = 1;
points[1] = 1;
points[2] = 3;
points[3] = 2;
points[4] = 4;
points[5] = 3;
/* there is 1 line */ nPolys = 1;
/* This array indicates the points per line */
pointsPerPoly[0] = 3;
/* Now call pipImportInsert...*/
pipImportInsert( impH, &pInfo, points, pointsPerPoly,nPolys );
For a region object with two polygons, the parameters may be set as follows:
pipObjectInfoStruct pInfo; intl points[16];
intl nPolys;
intl pointsPerPoly[2];
/* Define the members of pInfo structure */ pInfo.type = PIP_REGION;
strcpy( pInfo.name, "Squares" ); nPolys = 2;
/* This array indicates the points per poly, 4 in the first */
pointsPerPoly[0] = 4;
/* This part forms a square at 1,1 and 1,2, and 2,2 and 2,1 */
points[0] = 1;
points[1] = 1;
points[2] = 1;
points[3] = 2;
points[4] = 2;
points[5] = 2;
points[6] = 2;
points[7] = 1;
/* This array indicates the points per poly, 4 in the second */
pointsPerPoly[1] = 4;
/* This part forms a 2nd square 5,5 and 5,6 and 6,6 and 6,5 */
points[8] = 5;
points[9] = 5;
points[10] = 5;
points[11] = 6;
points[12] = 6;
points[13] = 6;
points[14] = 6;
points[15] = 5;
/* Now call pipImportInsert...*/
pipImportInsert( impH, pInfo, points, pointsPerPoly, nPolys );