MCPcopy Create free account
hub / github.com/creatale/node-dv / overlap

Method overlap

deps/tesseract/ccstruct/polyblk.cpp:304–340  ·  view source on GitHub ↗

@return true if the polygons of other and this overlap.

Source from the content-addressed store, hash-verified

302
303/// @return true if the polygons of other and this overlap.
304bool POLY_BLOCK::overlap(POLY_BLOCK *other) {
305 inT16 count; // winding count
306 ICOORDELT_IT it = &vertices; // iterator
307 ICOORD vertex;
308
309 if (!box.overlap(*(other->bounding_box())))
310 return false; // can't be any overlap.
311
312 /* see if a vertex of this is inside other */
313
314 do {
315 vertex = *it.data ();
316 // get winding number
317 count = other->winding_number (vertex);
318 if (count != INTERSECTING)
319 if (count != 0)
320 return true;
321 it.forward ();
322 }
323 while (!it.at_first ());
324
325 /* see if a vertex of other is inside this */
326
327 // switch lists
328 it.set_to_list (other->points ());
329 do {
330 vertex = *it.data();
331 // try other way round
332 count = winding_number (vertex);
333 if (count != INTERSECTING)
334 if (count != 0)
335 return true;
336 it.forward ();
337 }
338 while (!it.at_first ());
339 return false;
340}
341
342
343ICOORDELT_LIST *PB_LINE_IT::get_line(inT16 y) {

Callers 1

containsMethod · 0.45

Calls 7

dataMethod · 0.80
pointsMethod · 0.80
bounding_boxMethod · 0.45
winding_numberMethod · 0.45
forwardMethod · 0.45
at_firstMethod · 0.45
set_to_listMethod · 0.45

Tested by

no test coverage detected