123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- #include "RAList.h"
- #include <stdio.h>
- #include <assert.h>
- #include <stdlib.h>
-
-
-
- RAList::RAList( void )
- {
-
- label = -1;
- next = NULL;
-
- edgeStrength = 0;
- edgePixelCount = 0;
- }
- RAList::~RAList( void )
- {
-
- }
- int RAList::Insert(RAList *entry)
- {
-
-
- if(!next)
- {
-
- next = entry;
- entry->next = NULL;
-
- return 0;
- }
-
-
-
-
-
-
- if(next->label > entry->label)
- {
-
- entry->next = next;
- next = entry;
-
- return 0;
- }
-
- exists = 0;
- cur = next;
- while(cur)
- {
- if(entry->label == cur->label)
- {
-
- exists = 1;
- break;
- }
- else if((!(cur->next))||(cur->next->label > entry->label))
- {
-
- entry->next = cur->next;
- cur->next = entry;
- break;
- }
-
- cur = cur->next;
- }
-
-
- return (int)(exists);
- }
|