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

Go to the source code of this file.

Macros

#define IMAGE_WIN_NAME   "Edges"
 
#define IMAGE_XPOS   250
 
#define IMAGE_YPOS   0
 
#define EXTERN
 

Functions

create_edges_window

Create the edges window.

Parameters
page_trsize of image
ScrollViewcreate_edges_window (ICOORD page_tr)
 
draw_raw_edge

Draw the raw steps to the given window in the given colour.

Parameters
fdwindow to draw in
startstart of loop
colourcolour to draw in
void draw_raw_edge (ScrollView *fd, CRACKEDGE *start, ScrollView::Color colour)
 

Macro Definition Documentation

#define EXTERN

Definition at line 35 of file drawedg.cpp.

#define IMAGE_WIN_NAME   "Edges"

title of window

Definition at line 30 of file drawedg.cpp.

#define IMAGE_XPOS   250

Definition at line 31 of file drawedg.cpp.

#define IMAGE_YPOS   0

default position

Definition at line 33 of file drawedg.cpp.

Function Documentation

ScrollView* create_edges_window ( ICOORD  page_tr)

Definition at line 44 of file drawedg.cpp.

44  {
45  ScrollView* image_win; //image window
46 
47  //create the window
48  image_win = new ScrollView (IMAGE_WIN_NAME, IMAGE_XPOS, IMAGE_YPOS, 0, 0, page_tr.x (), page_tr.y ());
49  return image_win; //window
50 }
#define IMAGE_WIN_NAME
Definition: drawedg.cpp:30
ScrollView * image_win
Definition: pgedit.cpp:107
inT16 y() const
access_function
Definition: points.h:56
#define IMAGE_YPOS
Definition: drawedg.cpp:33
inT16 x() const
access function
Definition: points.h:52
#define IMAGE_XPOS
Definition: drawedg.cpp:31
void draw_raw_edge ( ScrollView fd,
CRACKEDGE start,
ScrollView::Color  colour 
)

Definition at line 62 of file drawedg.cpp.

64  {
65  CRACKEDGE *edgept; //current point
66 
67  fd->Pen(colour);
68  edgept = start;
69  fd->SetCursor(edgept->pos.x (), edgept->pos.y ());
70  do {
71  do
72  edgept = edgept->next;
73  //merge straight lines
74  while (edgept != start && edgept->prev->stepx == edgept->stepx && edgept->prev->stepy == edgept->stepy);
75 
76  //draw lines
77  fd->DrawTo(edgept->pos.x (), edgept->pos.y ());
78  }
79  while (edgept != start);
80 }
void Pen(Color color)
Definition: scrollview.cpp:726
ICOORD pos
Definition: crakedge.h:30
void DrawTo(int x, int y)
Definition: scrollview.cpp:531
CRACKEDGE * prev
Definition: crakedge.h:34
inT16 y() const
access_function
Definition: points.h:56
void SetCursor(int x, int y)
Definition: scrollview.cpp:525
inT8 stepx
Definition: crakedge.h:31
inT16 x() const
access function
Definition: points.h:52
CRACKEDGE * next
Definition: crakedge.h:35
inT8 stepy
Definition: crakedge.h:32