preparation before lw_dist2d_seg_seg.
2160{
2161 const POINT2D *p1, *p2, *p3, *p4, *p01, *p02;
2162 int pnr1, pnr2, pnr3, pnr4, n1, n2, i, u,
r, twist;
2163 double maxmeasure;
2166
2167 LWDEBUG(2,
"lw_dist2d_pre_seg_seg is called");
2168
2174 for (i = (n1 - 1); i >= 0; --i)
2175 {
2176
2177
2178 if (((list2[0].themeasure - list1[i].themeasure)) > maxmeasure)
2179 break;
2180
2181
2182 for (
r = -1;
r <= 1;
r += 2)
2183 {
2184 pnr1 = list1[i].
pnr;
2187 {
2189 if ((p1->
x == p01->
x) && (p1->
y == p01->
y))
2190 pnr2 = (n1 - 1);
2191 else
2192 pnr2 = pnr1;
2193
2194 }
2195
2196 else if (pnr1 +
r > (n1 - 1))
2197 {
2199 if ((p1->
x == p01->
x) && (p1->
y == p01->
y))
2200 pnr2 = 0;
2201 else
2202 pnr2 = pnr1;
2203
2204 }
2205 else
2207
2209 for (u = 0; u < n2; ++u)
2210 {
2211 if (((list2[u].themeasure - list1[i].themeasure)) >= maxmeasure)
2212 break;
2213 pnr3 = list2[u].
pnr;
2215 if (pnr3 == 0)
2216 {
2218 if ((p3->
x == p02->
x) && (p3->
y == p02->
y))
2219 pnr4 = (n2 - 1);
2220 else
2221 pnr4 = pnr3;
2222
2223 }
2224 else
2225 pnr4 = pnr3 - 1;
2226
2231
2232 if (pnr3 >= (n2 - 1))
2233 {
2235 if ((p3->
x == p02->
x) && (p3->
y == p02->
y))
2236 pnr4 = 0;
2237 else
2238 pnr4 = pnr3;
2239
2240 }
2241
2242 else
2243 pnr4 = pnr3 + 1;
2244
2249
2251 }
2252 }
2253 }
2254
2256}
#define LW_TRUE
Return types for functions with status returns.
#define LWDEBUG(level, msg)
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
int lw_dist2d_selected_seg_seg(const POINT2D *A, const POINT2D *B, const POINT2D *C, const POINT2D *D, DISTPTS *dl)
This is the same function as lw_dist2d_seg_seg but without any calculations to determine intersection...
int lw_dist2d_pt_pt(const POINT2D *thep1, const POINT2D *thep2, DISTPTS *dl)
Compares incoming points and stores the points closest to each other or most far away from each other...