textord/drawedg.cpp

Go to the documentation of this file.
00001 
00020 #include "mfcpch.h"
00021 #include "drawedg.h"
00022 #include "evnts.h"
00023 
00025 #define IMAGE_WIN_NAME    "Edges"
00026 #define IMAGE_XPOS      250
00027 #define IMAGE_YPOS      0        //default position
00028 #define CTRLD         '\004'     //control D
00029 
00030 #define EXTERN
00031 
00035 WINDOW create_edges_window(                //make window
00036                            ICOORD page_tr  //size of image
00037                           ) {
00038   WINDOW image_win;              //image window
00039 
00040                                  //create the window
00041   image_win = create_window (IMAGE_WIN_NAME, SCROLLINGWIN,
00042    IMAGE_XPOS, IMAGE_YPOS, 0, 0, (float) 0.0, page_tr.x (),
00043    (float) 0.0, page_tr.y (), TRUE, FALSE, FALSE, FALSE);
00044   #ifdef __MSW32__
00045   set_selection_handler(image_win, win_selection_handler); 
00046   #endif
00047   overlap_picture_ops(TRUE); 
00048   return image_win;              //window
00049 }
00050 
00051 
00055 void draw_raw_edge(                   //draw the cracks
00056                    WINDOW fd,         //window to draw in
00057                    CRACKEDGE *start,  //start of loop
00058                    COLOUR colour      //colour to draw in
00059                   ) {
00060   CRACKEDGE *edgept;             //current point
00061 
00062   line_color_index(fd, colour);  //in white
00063   edgept = start;
00064   move2d (fd, edgept->pos.x (), edgept->pos.y ());
00065   do {
00066     do
00067     edgept = edgept->next;
00068                                  //merge straight lines
00069     while (edgept != start && edgept->prev->stepx == edgept->stepx
00070       && edgept->prev->stepy == edgept->stepy);
00071 
00072                                  //draw lines
00073     draw2d (fd, edgept->pos.x (), edgept->pos.y ());
00074   }
00075   while (edgept != start);
00076 }
00077 
00078 // draw_edge_needles() removed for v1.03

Generated on Wed Feb 28 19:49:11 2007 for Tesseract by  doxygen 1.5.1