| 1 | // =============================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : ps_show_result.cxx // |
|---|
| 4 | // Purpose : // |
|---|
| 5 | // // |
|---|
| 6 | // Coded by Wolfram Foerster in October 2002 // |
|---|
| 7 | // Institute of Microbiology (Technical University Munich) // |
|---|
| 8 | // http://www.arb-home.de/ // |
|---|
| 9 | // // |
|---|
| 10 | // =============================================================== // |
|---|
| 11 | |
|---|
| 12 | #include "ps_defs.hxx" |
|---|
| 13 | #include "ps_bitmap.hxx" |
|---|
| 14 | |
|---|
| 15 | // ==================================================== |
|---|
| 16 | // ==================================================== |
|---|
| 17 | |
|---|
| 18 | int main(int argc, char *argv[]) { |
|---|
| 19 | |
|---|
| 20 | // open probe-set-database |
|---|
| 21 | if (argc < 2) { |
|---|
| 22 | printf("Missing argument\n Usage %s <file name>\n ", argv[0]); |
|---|
| 23 | exit(1); |
|---|
| 24 | } |
|---|
| 25 | |
|---|
| 26 | const char *input_filename = argv[1]; |
|---|
| 27 | printf("Opening result file '%s'..\n", input_filename); |
|---|
| 28 | PS_FileBuffer *file = new PS_FileBuffer(input_filename, PS_FileBuffer::READONLY); |
|---|
| 29 | |
|---|
| 30 | long size; |
|---|
| 31 | SpeciesID id1, id2; |
|---|
| 32 | printf("\nloading no matches : "); |
|---|
| 33 | file->get_long(size); |
|---|
| 34 | printf("%li", size); |
|---|
| 35 | for (long i=0; i < size; ++i) { |
|---|
| 36 | if (i % 5 == 0) printf("\n"); |
|---|
| 37 | file->get_int(id1); |
|---|
| 38 | file->get_int(id2); |
|---|
| 39 | printf("%5i %-5i ", id1, id2); |
|---|
| 40 | } |
|---|
| 41 | printf("\n\nloading one matches : "); |
|---|
| 42 | file->get_long(size); |
|---|
| 43 | printf("%li\n", size); |
|---|
| 44 | long path_length; |
|---|
| 45 | SpeciesID path_id; |
|---|
| 46 | for (long i=0; i < size; ++i) { |
|---|
| 47 | file->get_int(id1); |
|---|
| 48 | file->get_int(id2); |
|---|
| 49 | file->get_long(path_length); |
|---|
| 50 | printf("%5i %-5i path(%6li): ", id1, id2, path_length); |
|---|
| 51 | while (path_length-- > 0) { |
|---|
| 52 | file->get_int(path_id); |
|---|
| 53 | printf("%i ", path_id); |
|---|
| 54 | } |
|---|
| 55 | printf("\n"); |
|---|
| 56 | } |
|---|
| 57 | printf("\nloading preset bitmap\n"); |
|---|
| 58 | PS_BitMap_Counted *map = new PS_BitMap_Counted(file); |
|---|
| 59 | map->print(stdout); |
|---|
| 60 | delete map; |
|---|
| 61 | |
|---|
| 62 | return 0; |
|---|
| 63 | } |
|---|