src/ccstruct/coutln.cpp
bool C_OUTLINE::IsLegallyNested() const {
  if (stepcount == 0) {
    return true;
  }
  int64_t parent_area = outer_area();
  // We aren't going to modify the list, or its contents, but there is
  // no const iterator.
  C_OUTLINE_IT child_it(const_cast<C_OUTLINE_LIST *>(&children));
  for (child_it.mark_cycle_pt(); !child_it.cycled_list(); child_it.forward()) {
    const C_OUTLINE *child = child_it.data();
    if (child->outer_area() * parent_area > 0 || !child->IsLegallyNested()) {
      return false;
    }
  }
  return true;
}
/**
 * Returns true if *this and its children are legally nested.
 * The outer area of a child should have the opposite sign to the
 * parent. If not, it means we have discarded an outline in between
 * (probably due to excessive length).
 */
Returns true if *this and its children are legally nested.
The outer area of a child should have the opposite sign to the
parent. If not, it means we have discarded an outline in between
(probably due to excessive length).
Returns true if * this and its children are legally nested . The outer area of a child should have the opposite sign to the parent . If not it means we have discarded an outline in between ( probably due to excessive length ) .
bool C_OUTLINE::IsLegallyNested() const {
  if (stepcount == 0) {
    return true;
  }
  int64_t parent_area = outer_area();
  C_OUTLINE_IT child_it(const_cast<C_OUTLINE_LIST *>(&children));
  for (child_it.mark_cycle_pt(); !child_it.cycled_list(); child_it.forward()) {
    const C_OUTLINE *child = child_it.data();
    if (child->outer_area() * parent_area > 0 || !child->IsLegallyNested()) {
      return false;
    }
  }
  return true;
}
bool C_OUTLINE :: IsLegallyNested ( ) const { if ( stepcount == 0 ) { return true ; } int64_t parent_area = outer_area ( ) ; C_OUTLINE_IT child_it ( const_cast < C_OUTLINE_LIST * > ( & children ) ) ; for ( child_it . mark_cycle_pt ( ) ; ! child_it . cycled_list ( ) ; child_it . forward ( ) ) { const C_OUTLINE * child = child_it . data ( ) ; if ( child -> outer_area ( ) * parent_area > 0 || ! child -> IsLegallyNested ( ) ) { return false ; } } return true ; }
Returns true if *this and its children are legally nested.
Returns true if * this and its children are legally nested .
// We aren't going to modify the list, or its contents, but there is // no const iterator.