C_BLOB::C_BLOB( //constructor C_OUTLINE_LIST *outline_list //in random order ) { C_OUTLINE *outline; //current outline C_OUTLINE_IT it = outline_list;//iterator while (!it.empty ()) { //grab the list outline = it.extract (); //get off the list //put it in place position_outline(outline, &outlines); if (!it.empty ()) it.forward (); } it.set_to_list (&outlines); for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) { outline = it.data (); if (outline->turn_direction () < 0) { outline->reverse (); reverse_outline_list (outline->child ()); outline->set_flag (COUT_INVERSE, TRUE); } else { outline->set_flag (COUT_INVERSE, FALSE); } } }
static void reverse_outline_list( //reverse outlines C_OUTLINE_LIST *list //outline to reverse ) { C_OUTLINE *outline; //current outline C_OUTLINE_IT it = list; //iterator for (it.mark_cycle_pt (); !it.cycled_list (); it.forward ()) { outline = it.data (); outline->reverse (); //reverse it if (!outline->child ()->empty ()) reverse_outline_list (outline->child ()); } }