31 #define PBLOCK_LABEL_SIZE 150 32 #define INTERSECTING MAX_INT16 34 int lessthan(
const void *first,
const void *second);
37 ICOORDELT_IT v = &vertices;
49 ICOORDELT_IT v = &vertices;
70 ICOORDELT_IT pts = &vertices;
72 botleft = *pts.data ();
76 if (pos.
x () < botleft.
x ())
78 botleft =
ICOORD (pos.
x (), botleft.
y ());
79 if (pos.
y () < botleft.
y ())
80 botleft =
ICOORD (botleft.
x (), pos.
y ());
81 if (pos.
x () > topright.
x ())
82 topright =
ICOORD (pos.
x (), topright.
y ());
83 if (pos.
y () > topright.
y ())
84 topright =
ICOORD (topright.
x (), pos.
y ());
87 while (!pts.at_first ());
88 ibl =
ICOORD (botleft.
x (), botleft.
y ());
89 itr =
ICOORD (topright.
x (), topright.
y ());
90 box =
TBOX (ibl, itr);
107 ICOORDELT_IT it = &vertices;
113 vvec = *it.data_relative (1) - pt;
115 if (vec.
y () <= 0 && vec.
y () + vvec.
y () > 0) {
122 else if (vec.
y () > 0 && vec.
y () + vvec.
y () <= 0) {
129 else if (vec.
y () == 0 && vec.
x () == 0)
133 while (!it.at_first ());
141 ICOORDELT_IT it = &vertices;
150 vertex = *it.data ();
158 while (!it.at_first ());
163 it.set_to_list (other->
points ());
165 vertex = *it.data ();
173 while (!it.at_first ());
188 ICOORDELT_IT pts = &vertices;
199 while (!pts.at_first ());
211 ICOORDELT_IT pts = &vertices;
218 while (!pts.at_first());
232 ICOORDELT_IT pts = &vertices;
239 while (!pts.at_first ());
244 #ifndef GRAPHICS_DISABLED 246 ICOORDELT_IT v = &vertices;
255 #if defined(__UNIX__) || defined(MINGW) 258 ltoa (num, temp_buff, 10);
260 window->
Text(v.data ()->x (), v.data ()->y (), temp_buff);
263 window->
SetCursor(v.data ()->x (), v.data ()->y ());
264 for (v.mark_cycle_pt (); !v.cycled_list (); v.forward ()) {
265 window->
DrawTo(v.data ()->x (), v.data ()->y ());
268 window->
DrawTo(v.data ()->x (), v.data ()->y ());
276 ICOORDELT_LIST *segments;
285 if (!segments->empty ()) {
286 s_it.set_to_list (segments);
287 for (s_it.mark_cycle_pt (); !s_it.cycled_list (); s_it.forward ()) {
291 width = s_it.data ()->y ();
292 window->
SetCursor(s_it.data ()->x (), y);
293 window->
DrawTo(s_it.data ()->x () + (float) width, y);
306 ICOORDELT_IT it = &vertices;
315 vertex = *it.data ();
323 while (!it.at_first ());
328 it.set_to_list (other->
points ());
338 while (!it.at_first ());
345 ICOORDELT_LIST *result;
349 fy = (float) (y + 0.5);
350 result =
new ICOORDELT_LIST ();
351 r.set_to_list (result);
352 v.set_to_list (block->
points ());
354 for (v.mark_cycle_pt (); !v.cycled_list (); v.forward ()) {
355 if (((v.data_relative (-1)->y () > y) && (v.data ()->y () <= y))
356 || ((v.data_relative (-1)->y () <= y) && (v.data ()->y () > y))) {
357 previous = v.data_relative (-1);
359 fx = (float) (0.5 + previous->
x () +
360 (current->
x () - previous->
x ()) * (fy -
362 (current->
y () - previous->
y ()));
370 for (r.mark_cycle_pt (); !r.cycled_list (); r.forward ())
372 for (r.mark_cycle_pt (); !r.cycled_list (); r.forward ()) {
373 r.data ()->
set_y (r.data_relative (1)->x () - r.data ()->x ());
375 delete (r.extract ());
383 int lessthan(
const void *first,
const void *second) {
387 if (p1->
x () < p2->
x ())
389 else if (p1->
x () > p2->
x ())
395 #ifndef GRAPHICS_DISABLED 417 return kPBColors[type];
421 #endif // GRAPHICS_DISABLED void DrawTo(int x, int y)
bool overlap(POLY_BLOCK *other)
void fill(ScrollView *window, ScrollView::Color colour)
bool overlap(const TBOX &box) const
void rotate(FCOORD rotation)
void SetCursor(int x, int y)
ICOORDELT_LIST * points()
void TextAttributes(const char *font, int pixel_size, bool bold, bool italic, bool underlined)
void Text(int x, int y, const char *mystring)
ICOORDELT_LIST * get_line(inT16 y)
int lessthan(const void *first, const void *second)
void set_x(float xin)
rewrite function
void rotate(const FCOORD vec)
inT16 x() const
access function
void set_y(float yin)
rewrite function
bool contains(POLY_BLOCK *other)
void set_y(inT16 yin)
rewrite function
inT16 winding_number(const ICOORD &test_pt)
void set_x(inT16 xin)
rewrite function
static ScrollView::Color ColorForPolyBlockType(PolyBlockType type)
Returns a color to draw the given type.
void plot(ScrollView *window, inT32 num)
inT16 y() const
access_function