All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
plotedges.cpp File Reference
#include "plotedges.h"
#include "render.h"
#include "split.h"

Go to the source code of this file.

Functions

void display_edgepts (LIST outlines)
 
void draw_blob_edges (TBLOB *blob)
 
void mark_outline (EDGEPT *edgept)
 

Variables

ScrollViewedge_window = NULL
 

Function Documentation

void display_edgepts ( LIST  outlines)

Definition at line 53 of file plotedges.cpp.

53  {
54  void *window;
55  /* Set up window */
56  if (edge_window == NULL) {
57  edge_window = c_create_window ("Edges", 750, 150,
58  400, 128, -400.0, 400.0, 0.0, 256.0);
59  }
60  else {
62  }
63  /* Render the outlines */
64  window = edge_window;
65  /* Reclaim old memory */
66  iterate(outlines) {
67  render_edgepts (window, (EDGEPT *) first_node (outlines), White);
68  }
69 }
Definition: callcpp.h:34
void render_edgepts(void *window, EDGEPT *edgept, C_COL color)
Definition: render.cpp:98
ScrollView * c_create_window(const char *name, inT16 xpos, inT16 ypos, inT16 xsize, inT16 ysize, double xmin, double xmax, double ymin, double ymax)
Definition: callcpp.cpp:55
#define first_node(l)
Definition: oldlist.h:139
#define iterate(l)
Definition: oldlist.h:159
Definition: blobs.h:76
void c_clear_window(void *win)
Definition: callcpp.cpp:104
#define NULL
Definition: host.h:144
ScrollView * edge_window
Definition: plotedges.cpp:43
void draw_blob_edges ( TBLOB blob)

Definition at line 77 of file plotedges.cpp.

77  {
78  TESSLINE *ol;
79  LIST edge_list = NIL_LIST;
80 
82  for (ol = blob->outlines; ol != NULL; ol = ol->next)
83  push_on (edge_list, ol->loop);
84  display_edgepts(edge_list);
85  destroy(edge_list);
86  }
87 }
bool wordrec_display_splits
Definition: split.cpp:44
#define push_on(list, thing)
Definition: oldlist.h:200
#define NIL_LIST
Definition: oldlist.h:126
TESSLINE * next
Definition: blobs.h:258
LIST destroy(LIST list)
Definition: oldlist.cpp:187
#define NULL
Definition: host.h:144
TESSLINE * outlines
Definition: blobs.h:377
EDGEPT * loop
Definition: blobs.h:257
void display_edgepts(LIST outlines)
Definition: plotedges.cpp:53
void mark_outline ( EDGEPT edgept)

Definition at line 95 of file plotedges.cpp.

95  { /* Start of point list */
96  void *window = edge_window;
97  float x = edgept->pos.x;
98  float y = edgept->pos.y;
99 
100  c_line_color_index(window, Red);
101  c_move(window, x, y);
102 
103  x -= 4;
104  y -= 12;
105  c_draw(window, x, y);
106 
107  x -= 2;
108  y += 4;
109  c_draw(window, x, y);
110 
111  x -= 4;
112  y += 2;
113  c_draw(window, x, y);
114 
115  x += 10;
116  y += 6;
117  c_draw(window, x, y);
118 
119  c_make_current(window);
120 }
void c_line_color_index(void *win, C_COL index)
Definition: callcpp.cpp:70
inT16 y
Definition: blobs.h:72
Definition: callcpp.h:35
inT16 x
Definition: blobs.h:71
void c_draw(void *win, double x, double y)
Definition: callcpp.cpp:88
void c_make_current(void *win)
Definition: callcpp.cpp:97
TPOINT pos
Definition: blobs.h:163
void c_move(void *win, double x, double y)
Definition: callcpp.cpp:79
ScrollView * edge_window
Definition: plotedges.cpp:43

Variable Documentation

ScrollView* edge_window = NULL

Definition at line 43 of file plotedges.cpp.