* ogrPointsAddPoint() * * NOTE: This function assumes the line->point array already has been * allocated large enough for the point to be added, but that numpoints * does not include this new point. **********************************************************************/
| 97 | * does not include this new point. |
| 98 | **********************************************************************/ |
| 99 | static void ogrPointsAddPoint(lineObj *line, double dX, double dY, |
| 100 | int lineindex, rectObj *bounds) |
| 101 | { |
| 102 | /* Keep track of shape bounds */ |
| 103 | if (line->numpoints == 0 && lineindex == 0) |
| 104 | { |
| 105 | bounds->minx = bounds->maxx = dX; |
| 106 | bounds->miny = bounds->maxy = dY; |
| 107 | } |
| 108 | else |
| 109 | { |
| 110 | if (dX < bounds->minx) bounds->minx = dX; |
| 111 | if (dX > bounds->maxx) bounds->maxx = dX; |
| 112 | if (dY < bounds->miny) bounds->miny = dY; |
| 113 | if (dY > bounds->maxy) bounds->maxy = dY; |
| 114 | } |
| 115 | |
| 116 | line->point[line->numpoints].x = dX; |
| 117 | line->point[line->numpoints].y = dY; |
| 118 | #ifdef USE_POINT_Z_M |
| 119 | line->point[line->numpoints].z = 0.0; |
| 120 | line->point[line->numpoints].m = 0.0; |
| 121 | #endif |
| 122 | line->numpoints++; |
| 123 | } |
| 124 | |
| 125 | /********************************************************************** |
| 126 | * ogrGeomPoints() |