~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/vision/edge/linkedges.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /**@(#)
  2 **/
  3 /* linkedge.c
  4  * 
  5  * functions to connect edge strings
  6  * 
  7  * rewriten to use static variables rather than property list for data
  8  * manipulatin
  9  * 
 10  */
 11 
 12 #include <math.h>
 13 #include <tina/sys.h>
 14 #include <tina/sys_types.h>
 15 #include <tina/sysfuncs.h>
 16 #include <tina/math.h>
 17 #include <tina/mathfuncs.h>
 18 #include <tina/vision.h>
 19 #include <tina/tina_types.h>
 20 #include <tina/visionfuncs.h>
 21 #include <tina/edge.h>
 22 
 23 #define MAX_GAP 3
 24 #define SPUR_LENGTH_THRES 5
 25 #define TEE_ORIENTATION_THRES PIBY2
 26 
 27 /* lists of special edge points and strings manipulated by linking
 28  * functions */
 29 
 30 static List *junc_list;
 31 static List *term_list;
 32 static List *string_list;
 33 
 34 static void edge_set_conn_type_on(Edgel * edge)
 35 {
 36     edge->type &= EDGE_SET_CONN_MASK;
 37     edge->type |= EDGE_CONN;
 38 }
 39 
 40 #if 0
 41 static void edge_set_conn_type_off(Edgel * edge)
 42 {
 43     edge->type &= EDGE_SET_CONN_MASK;
 44 }
 45 
 46 #endif
 47 
 48 static void edge_set_conn_type(Edgel * edge)
 49 {
 50     Edge_conn *econn;
 51 
 52     if (edge == NULL || !(edge->type & EDGE_GET_CONN_MASK))
 53         return;
 54 
 55     edge->type &= EDGE_SET_CONN_MASK;
 56     econn = (Edge_conn *) prop_get(edge->props, EDGE_CONN);
 57 
 58     if (econn == NULL)
 59         edge->type |= EDGE_NOLINK;
 60 
 61     switch (econn->count)
 62     {
 63     case 0:
 64         edge->type |= EDGE_NOLINK;
 65         break;
 66     case 1:
 67         {
 68             edge->type |= EDGE_TERMIN;
 69             break;
 70         }
 71     case 2:
 72         edge->type |= EDGE_CONN;
 73         break;
 74     default:
 75         {
 76             edge->type |= EDGE_JUNC;
 77             break;
 78         }
 79     }
 80 }
 81 
 82 /* ARGSUSED quieten lint */
 83 static void edge_set_conns(Edgel * edge, int type, Imrect * er, int i, int j)
 84 
 85 /* not used */
 86 
 87 /* edgerect location */
 88 {
 89     Edgel  *eptr;
 90     Edgel  *er_get_edge();
 91     Edge_conn *econn;
 92     Edge_conn *econn_alloc();
 93     void    econn_free();
 94     int     n = 0, e = 0, w = 0, s = 0;
 95 
 96     if (er == NULL || edge == NULL || !(edge->type & EDGE_GET_CONN_MASK))
 97         return;
 98 
 99     if ((econn = (Edge_conn *) prop_get(edge->props, EDGE_CONN)) == NULL)
100     {
101         econn = econn_alloc();
102         edge->props = proplist_add(edge->props, (void *) econn, EDGE_CONN, econn_free);
103     }
104     econn->c1 = NULL;
105     econn->c2 = NULL;
106     list_rm_links(econn->conns);
107     econn->conns = NULL;
108     econn->count = 0;
109 
110     if ((eptr = er_get_edge(er, i - 1, j)) != NULL &&
111         eptr->type & EDGE_GET_CONN_MASK)
112     {
113         n = 1;
114         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
115         econn->count++;
116     }
117     if ((eptr = er_get_edge(er, i + 1, j)) != NULL &&
118         eptr->type & EDGE_GET_CONN_MASK)
119     {
120         s = 1;
121         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
122         econn->count++;
123     }
124     if ((eptr = er_get_edge(er, i, j - 1)) != NULL &&
125         eptr->type & EDGE_GET_CONN_MASK)
126     {
127         e = 1;
128         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
129         econn->count++;
130     }
131     if ((eptr = er_get_edge(er, i, j + 1)) != NULL &&
132         eptr->type & EDGE_GET_CONN_MASK)
133     {
134         w = 1;
135         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
136         econn->count++;
137     }
138     if (!n && !w && (eptr = er_get_edge(er, i - 1, j + 1)) != NULL &&
139         eptr->type & EDGE_GET_CONN_MASK)
140     {
141         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
142         econn->count++;
143     }
144     if (!n && !e && (eptr = er_get_edge(er, i - 1, j - 1)) != NULL &&
145         eptr->type & EDGE_GET_CONN_MASK)
146     {
147         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
148         econn->count++;
149     }
150     if (!s && !w && (eptr = er_get_edge(er, i + 1, j + 1)) != NULL &&
151         eptr->type & EDGE_GET_CONN_MASK)
152     {
153         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
154         econn->count++;
155     }
156     if (!s && !e && (eptr = er_get_edge(er, i + 1, j - 1)) != NULL &&
157         eptr->type & EDGE_GET_CONN_MASK)
158     {
159         econn->conns = link_addtostart((List *) econn->conns, link_alloc((void *) eptr, EDGE));
160         econn->count++;
161     }
162     switch (econn->count)
163     {
164     case 0:
165         break;
166     case 1:                     /* termination point: add to
167                                  * termination list */
168         term_list = ref_addtostart((List *) term_list, (void *) edge, EDGE);
169         break;
170     case 2:                     /* standard connect: now finished with */
171         econn->c1 = (Edgel *) econn->conns->to;
172         econn->c2 = (Edgel *) econn->conns->next->to;
173         list_rm_links(econn->conns);
174         econn->conns = NULL;
175         break;
176     default:                    /* potential junction: add to junction
177                                  * list */
178         {
179             junc_list = ref_addtostart((List *) junc_list, (void *) edge, EDGE);
180             break;
181         }
182     }
183 }
184 
185 static List *bridge_small_gaps(List * terms)
186 /* list of termination points */
187 {
188     List   *lptr1;
189     List   *lptr2;
190     List   *lmin;
191     Edgel  *edge1;
192     Edgel  *edge2;
193     Edge_conn *conn1;
194     Edge_conn *conn2;
195     double  min_diff, diff;
196     Vec2    v1 = {Vec2_id};
197     Vec2    v2 = {Vec2_id};
198     Vec2    v = {Vec2_id};
199 
200     if (terms == NULL || terms->next == NULL)
201         return (terms);
202 
203     for (lptr1 = terms; lptr1->next != NULL; lptr1 = lptr1->next)
204     {
205         if (lptr1->type == REMOVE_ME)
206             continue;
207 
208         edge1 = (Edgel *) lptr1->to;
209         conn1 = (Edge_conn *) prop_get(edge1->props, EDGE_CONN);
210         v1 = vec2_diff(edge1->pos, ((Edgel *) (conn1->conns->to))->pos);
211         v1 = vec2_unit(v1);
212         lmin = NULL;
213         min_diff = MAX_GAP;
214 
215         for (lptr2 = lptr1->next; lptr2 != NULL; lptr2 = lptr2->next)
216         {
217             if (lptr2->type == REMOVE_ME)
218                 continue;
219 
220             edge2 = (Edgel *) lptr2->to;
221 
222             v = vec2_diff(edge2->pos, edge1->pos);
223             diff = vec2_mod(v);
224             if (diff > min_diff)
225                 continue;
226 
227             v = vec2_unit(v);
228             if (vec2_dot(v1, v) < 0.9)
229                 continue;
230 
231             conn2 = (Edge_conn *) prop_get(edge2->props, EDGE_CONN);
232             v2 = vec2_diff(edge2->pos, ((Edgel *) (conn2->conns->to))->pos);
233             v2 = vec2_unit(v2);
234 
235             if (vec2_dot(v2, v) > -0.9)
236                 continue;
237 
238             lmin = lptr2;
239             min_diff = diff;
240         }
241 
242         if (lmin == NULL)
243             continue;
244 
245         edge2 = (Edgel *) lmin->to;
246         conn2 = (Edge_conn *) prop_get(edge2->props, EDGE_CONN);
247 
248         conn1->c1 = conn1->conns->to;
249         conn2->c1 = conn2->conns->to;
250         conn1->c2 = edge2;
251         conn2->c2 = edge1;
252         list_rm_links(conn1->conns);
253         list_rm_links(conn2->conns);
254         conn1->conns = conn2->conns = NULL;
255         conn1->count = conn2->count = 2;
256 
257         lptr1->type = lmin->type = REMOVE_ME;
258     }
259     return (list_rm_links_on_type(terms, REMOVE_ME));
260 }
261 
262 static int shortspur(Edgel * spur, Edgel * last, int thres, int count)
263 {
264     Edgel  *next;
265     Edge_conn *conn = (Edge_conn *) prop_get(spur->props, EDGE_CONN);
266 
267     if (count > thres || conn->count > 2)       /* another junction */
268         return (0);
269 
270     if (conn->count == 1)       /* a termination */
271         return (count);
272 
273     next = (conn->c1 == last) ? conn->c2 : conn->c1;
274 
275     return (shortspur(next, spur, thres, count + 1));
276 }
277 
278 static List *prunespurs(List * juncs)
279 {
280     List   *jptr;
281     int     count;
282 
283     for (jptr = juncs; jptr != NULL; jptr = jptr->next)
284     {
285         Edgel  *eptr = (Edgel *) jptr->to;
286         Edge_conn *econn;
287         List   *cptr;
288         List   *short_spurs = NULL;
289 
290         econn = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
291 
292         for (cptr = econn->conns; cptr != NULL; cptr = cptr->next)
293         {
294             Edgel  *spur = (Edgel *) cptr->to;
295             List   *lptr;
296             List   *link;
297             int     spur_len;
298 
299             if ((spur_len = shortspur(spur, eptr, SPUR_LENGTH_THRES, 1)))       /* short */
300             {
301                 link = link_alloc((void *) cptr, spur_len);
302                 if (short_spurs == NULL || spur_len < short_spurs->type)
303                     short_spurs = link_addtostart((List *) short_spurs, link);
304                 else
305                 {
306                     for (lptr = short_spurs; lptr->next != NULL; lptr = lptr->next)
307                         if (spur_len < lptr->next->type)
308                             break;
309                     link_addafter(lptr, link);
310                 }
311             }
312         }
313 
314         if (short_spurs == NULL)
315             continue;
316 
317         for (cptr = short_spurs, count = econn->count; cptr != NULL; cptr = cptr->next)
318         {
319             Edge_conn *sconn;
320             Edgel  *spur = (Edgel *) ((List *) cptr->to)->to;
321 
322             sconn = (Edge_conn *) prop_get(spur->props, EDGE_CONN);
323 
324             if (sconn->count == 1)      /* terminal */
325             {
326                 list_rm_links(sconn->conns);
327                 sconn->conns = NULL;
328                 sconn->count = 0;
329                 term_list = list_rm_ref(term_list, (void *) spur, (void (*) ()) NULL);
330             } else
331             {
332                 /* sconn->count==2 */
333                 if (sconn->c1 == eptr)
334                     sconn->conns = link_alloc((void *) sconn->c2, EDGE);
335                 else
336                     sconn->conns = link_alloc((void *) sconn->c1, EDGE);
337                 sconn->c1 = sconn->c2 = NULL;
338                 sconn->count = 1;
339                 term_list = ref_addtostart((List *) term_list, (void *) spur, EDGE);
340             }
341             ((List *) cptr->to)->type = REMOVE_ME;
342             if (--count == 2)   /* simple connection */
343                 break;
344         }
345         list_rm_links(short_spurs);
346         econn->conns = list_rm_links_on_type(econn->conns, REMOVE_ME);
347     }
348 
349     for (jptr = juncs; jptr != NULL; jptr = jptr->next)
350     {
351         Edgel  *eptr = (Edgel *) jptr->to;
352         Edge_conn *econn;
353         List   *cptr;
354 
355         econn = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
356         econn->count = 0;
357         for (cptr = econn->conns; cptr != NULL; cptr = cptr->next)
358             ++econn->count;
359 
360         switch (econn->count)
361         {
362         case 0:
363             jptr->type = REMOVE_ME;
364             break;
365         case 1:
366             term_list = ref_addtostart((List *) term_list, (void *) eptr, EDGE);
367             jptr->type = REMOVE_ME;
368             break;
369         case 2:
370             econn->c1 = (Edgel *) econn->conns->to;
371             econn->c2 = (Edgel *) econn->conns->next->to;
372             list_rm_links(econn->conns);
373             econn->conns = NULL;
374             jptr->type = REMOVE_ME;
375             break;
376         default:
377             break;
378         }
379     }
380     return (list_rm_links_on_type(juncs, REMOVE_ME));
381 }
382 
383 static void rmjuncs(List * juncs)
384 {
385     List   *jptr;
386 
387     for (jptr = juncs; jptr != NULL; jptr = jptr->next)
388     {
389         Edgel  *eptr = (Edgel *) jptr->to;
390         Edge_conn *econn;
391         List   *cptr;
392 
393         econn = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
394 
395         for (cptr = econn->conns; cptr != NULL; cptr = cptr->next)
396         {
397             Edgel  *nptr = (Edgel *) cptr->to;
398             Edge_conn *nconn;
399 
400             nconn = (Edge_conn *) prop_get(nptr->props, EDGE_CONN);
401             switch (nconn->count)
402             {
403             case 1:
404                 rfree((void *) nconn->conns);
405                 nconn->conns = NULL;
406                 nconn->count = 0;
407                 term_list = list_rm_ref(term_list, (void *) nptr, (void (*) ()) NULL);
408                 break;
409             case 2:
410                 {
411                     Edgel  *keep = (nconn->c1 == eptr) ? nconn->c2 : nconn->c1;
412 
413                     nconn->conns = link_alloc((void *) keep, EDGE);
414                     nconn->count = 1;
415                     term_list = ref_addtostart((List *) term_list, (void *) nptr, EDGE);
416                     break;
417                 }
418             default:
419                 break;          /* junctions take care of themselves */
420             }
421         }
422         list_rm_links(econn->conns);
423         econn->conns = NULL;
424         econn->count = 0;
425         edge_set_type_remove_me(eptr);
426     }
427 }
428 
429 static List *prunejuncs(List * juncs)
430 {
431     List   *jptr;
432 
433     for (jptr = juncs; jptr != NULL; jptr = jptr->next)
434     {
435         Edgel  *eptr = (Edgel *) jptr->to;
436         Edge_conn *econn;
437         List   *cptr;
438 
439         econn = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
440 
441         for (cptr = econn->conns; cptr != NULL; cptr = cptr->next)
442         {
443             Edgel  *nptr = (Edgel *) cptr->to;
444             Edge_conn *nconn;
445 
446             nconn = (Edge_conn *) prop_get(nptr->props, EDGE_CONN);
447             if (nconn->count > 2)       /* a neighbouring junction */
448                 cptr->type = REMOVE_ME;
449         }
450         econn->conns = list_rm_links_on_type(econn->conns, REMOVE_ME);
451     }
452 
453     for (jptr = juncs; jptr != NULL; jptr = jptr->next)
454     {
455         Edgel  *eptr = (Edgel *) jptr->to;
456         Edge_conn *econn;
457         List   *cptr;
458 
459         econn = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
460 
461         econn->count = 0;
462         for (cptr = econn->conns; cptr != NULL; cptr = cptr->next)
463             ++econn->count;
464 
465         switch (econn->count)
466         {
467         case 0:
468             jptr->type = REMOVE_ME;
469             break;
470         case 1:
471             term_list = ref_addtostart((List *) term_list, (void *) eptr, EDGE);
472             jptr->type = REMOVE_ME;
473             break;
474         case 2:
475             econn->c1 = (Edgel *) econn->conns->to;
476             econn->c2 = (Edgel *) econn->conns->next->to;
477             list_rm_links(econn->conns);
478             econn->conns = NULL;
479             jptr->type = REMOVE_ME;
480         default:
481             break;
482         }
483     }
484     return (list_rm_links_on_type(juncs, REMOVE_ME));
485 }
486 
487 static List *prunetees(List * juncs)
488 {
489     List   *jptr;
490 
491     for (jptr = juncs; jptr != NULL; jptr = jptr->next)
492     {
493         Edgel  *eptr = (Edgel *) jptr->to;
494         Edgel  *links[3];
495         Edge_conn *econn;
496         Edge_conn *lconn[3];
497         int     i, j;
498         int     c1 = 0, c2 = 0, c3;
499         float   mindif = (float)TWOPI;
500 
501         econn = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
502 
503         if (econn->count != 3)  /* not a three way junction */
504             continue;
505 
506         links[0] = (Edgel *) econn->conns->to;
507         links[1] = (Edgel *) econn->conns->next->to;
508         links[2] = (Edgel *) econn->conns->next->next->to;
509 
510         for (i = 0; i < 3; ++i)
511         {
512             lconn[i] = (Edge_conn *) prop_get(links[i]->props, EDGE_CONN);
513             if (lconn[i]->count != 2)   /* not a simple continue */
514                 break;
515         }
516         if (i < 3)
517             continue;
518 
519         for (i = 0; i < 2; ++i)
520             for (j = i + 1; j < 3; ++j)
521             {
522                 float   absordif = (float)fabs(links[i]->orient - links[j]->orient);
523 
524                 absordif = (float)MIN(absordif, TWOPI - absordif);
525 
526                 if (absordif < mindif)
527                 {
528                     c1 = i;
529                     c2 = j;
530                     mindif = absordif;
531                 }
532             }
533 
534         if (mindif > TEE_ORIENTATION_THRES)
535             continue;
536 
537         econn->c1 = links[c1];
538         econn->c2 = links[c2];
539 
540         list_rm_links(econn->conns);
541         econn->conns = NULL;
542         econn->count = 2;
543 
544         jptr->type = REMOVE_ME;
545 
546         c3 = 3 - c1 - c2;
547         econn = lconn[c3];      /* Edge_conn of the remaining edge */
548         econn->conns = link_alloc((void *)
549                  ((econn->c1 == eptr) ? econn->c2 : econn->c1), EDGE);
550         econn->c1 = econn->c2 = NULL;
551         econn->count = 1;
552         term_list = ref_addtostart((List *) term_list, (void *) links[c3], EDGE);       /* new term */
553     }
554     return (list_rm_links_on_type(juncs, REMOVE_ME));
555 }
556 
557 static Tstring *edge_getloop(Edgel * edge)
558 {
559     List *start = NULL;
560     List *end = NULL;
561     Edge_conn *cptr;
562     Edgel  *eptr;
563     Edgel  *from;
564 
565     if (edge == NULL || !(edge->type & EDGE_GET_CONN_MASK))
566         return (NULL);
567 
568     cptr = (Edge_conn *) prop_get(edge->props, EDGE_CONN);
569     if (cptr->count != 2)
570         return (NULL);
571     start = end = dd_link_alloc((void *) edge, EDGE);
572     from = edge;
573     edge->type |= EDGE_LOOP;
574 
575     for (eptr = cptr->c1; eptr != edge; eptr = cptr->c1)
576     {
577         end = dd_link_addtoend(end, dd_link_alloc((void *) eptr, EDGE));
578         cptr = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
579         eptr->type |= EDGE_LOOP;
580         if (cptr->c2 != from)
581             SWAP(Edgel *, cptr->c1, cptr->c2)
582                 from = eptr;
583     }
584 
585     start->last = end;          /* to complete the loop */
586     end->next = start;
587 
588     return (str_make(LOOP, start, end));
589 }
590 
591 static void edge_find_loops(Edgel * edge)
592 {
593     Tstring *string;
594 
595     if (edge == NULL || edge->type & EDGE_GET_LOOP_MASK ||
596         (edge->type & EDGE_GET_CONN_MASK) != EDGE_CONN)
597         return;
598 
599     string = edge_getloop(edge);
600     if (string != NULL)
601         string_list = ref_addtostart((List *) string_list, (void *) string, STRING);
602 }
603 
604 static Tstring *edge_getstring(Edgel * term)
605 {
606     List *start = NULL;
607     List *end = NULL;
608     Edge_conn *cptr;
609     Edgel  *eptr;
610     Edgel  *from;
611 
612     if (term == NULL)
613         return (NULL);
614 
615     cptr = (Edge_conn *) prop_get(term->props, EDGE_CONN);
616     if (cptr->count != 1)
617         return (NULL);
618     start = end = dd_link_alloc((void *) term, EDGE);
619     from = term;
620     term->type |= EDGE_NOT_LOOP;
621 
622     for (eptr = (Edgel *) cptr->conns->to;; eptr = cptr->c1)
623     {
624         end = dd_link_addtoend(end, dd_link_alloc((void *) eptr, EDGE));
625         cptr = (Edge_conn *) prop_get(eptr->props, EDGE_CONN);
626         eptr->type |= EDGE_NOT_LOOP;
627         if (cptr->count != 2)
628             break;
629 
630         if (cptr->c2 != from)
631             SWAP(Edgel *, cptr->c1, cptr->c2)
632                 from = eptr;
633     }
634 
635     return (str_make(STRING, start, end));
636 }
637 
638 static List *findstrings(List * terms)
639 {
640     List   *tptr;
641     List   *strings = NULL;
642 
643     terms = list_copy(terms, (void *(*) ()) NULL, NULL);
644 
645     tptr = terms;
646     while (tptr != NULL)
647     {
648         Tstring *sptr = edge_getstring((Edgel *) tptr->to);
649 
650         strings = link_addtostart((List *) strings, link_alloc((void *) sptr, STRING));
651         (void) list_rm_ref(tptr, sptr->end->to, (void (*) ()) NULL);
652         tptr = link_rm_el(tptr);
653     }
654 
655     return (strings);
656 }
657 
658 void    er_find_edge_strings(Imrect * er)
659 /* edge rect */
660 {
661     void    er_apply_to_all_edges();
662 
663     if (er == NULL)
664         return;
665 
666     /* first set conn field of edge type to allow all possible
667      * connections */
668     er_apply_to_all_edges(er, edge_set_conn_type_on, NULL);
669     er_apply_to_all_edges(er, edge_set_conns, (void *) er);
670 
671     junc_list = prunespurs(junc_list);
672     junc_list = prunetees(junc_list);
673     junc_list = prunejuncs(junc_list);
674     rmjuncs(junc_list);
675     list_rm_links(junc_list);
676 
677     term_list = bridge_small_gaps(term_list);
678     string_list = findstrings(term_list);
679     list_rm_links(term_list);
680     junc_list = term_list = NULL;
681 
682     er_apply_to_all_edges(er, edge_set_conn_type, NULL);
683     er_apply_to_all_edges(er, edge_find_loops, NULL);   /* adds to string_list */
684 
685     er->props = proplist_addifnp(er->props, (void *) string_list, STRING, str_rm_list, false);
686 }
687 
688 void    er_find_simple_edge_strings(Imrect * er)
689 /* edge rect */
690 {
691     void    er_apply_to_all_edges();
692 
693     if (er == NULL)
694         return;
695 
696     /* first set conn field of edge type to allow all possible
697      * connections */
698     er_apply_to_all_edges(er, edge_set_conn_type_on, NULL);
699     er_apply_to_all_edges(er, edge_set_conns, (void *) er);
700 
701     junc_list = prunespurs(junc_list);
702     rmjuncs(junc_list);
703     list_rm_links(junc_list);
704 
705     string_list = findstrings(term_list);
706     list_rm_links(term_list);
707     junc_list = term_list = NULL;
708 
709     er_apply_to_all_edges(er, edge_set_conn_type, NULL);
710     er_apply_to_all_edges(er, edge_find_loops, NULL);   /* adds to string_list */
711 
712     er->props = proplist_addifnp(er->props, (void *) string_list, STRING, str_rm_list, false);
713 }
714 
715 List   *er_specific_edge_strings(Imrect * er, void (*func) ( /* ??? */ ), void *data)
716 /* edge rect */
717 
718 
719 {
720     void    er_apply_to_all_edges();
721 
722     if (er == NULL)
723         return ((List *) NULL);
724 
725     /* first set conn field using function */
726     er_apply_to_all_edges(er, func, (void *) data);
727     er_apply_to_all_edges(er, edge_set_conns, (void *) er);
728 
729     junc_list = prunespurs(junc_list);
730     rmjuncs(junc_list);
731     list_rm_links(junc_list);
732 
733     string_list = findstrings(term_list);
734     list_rm_links(term_list);
735     junc_list = term_list = NULL;
736 
737     er_apply_to_all_edges(er, edge_set_conn_type, NULL);
738     er_apply_to_all_edges(er, edge_find_loops, NULL);   /* adds to string_list */
739 
740     return (string_list);
741 }
742 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.