bool wxBlockDouble::Combine(const wxBlockDouble &b) { if (!Touches(b)) return false; if (Contains(b)) return true; if (b.Contains(*this)) { *this = b; return true; } wxBlockDouble unionBlock; Union( *this, b, &unionBlock ); if (unionBlock.IsEmpty()) return false; // at least one of the two blocks has to be at each corner of the union if (((unionBlock.GetLeftTop() == GetLeftTop()) || (unionBlock.GetLeftTop() == b.GetLeftTop())) && ((unionBlock.GetRightTop() == GetRightTop()) || (unionBlock.GetRightTop() == b.GetRightTop())) && ((unionBlock.GetLeftBottom() == GetLeftBottom()) || (unionBlock.GetLeftBottom() == b.GetLeftBottom())) && ((unionBlock.GetRightBottom() == GetRightBottom()) || (unionBlock.GetRightBottom() == b.GetRightBottom())) ) { *this = unionBlock; return true; } return false; }
Line Box::GetLeftLine() { Line l(GetLeftTop(), GetLeftBot()); return l; }
Line Box::GetTopLine() { Line l(GetRightTop(), GetLeftTop()); return l; }