void CRectangle::Draw(ICanvas & canvas) const { CShape::Draw(canvas); canvas.DrawLine(m_leftTop, GetRightTop()); canvas.DrawLine(GetRightTop(), m_rightBottom); canvas.DrawLine(m_rightBottom, GetLeftBottom()); canvas.DrawLine(GetLeftBottom(), m_leftTop); }
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::GetTopLine() { Line l(GetRightTop(), GetLeftTop()); return l; }
Line Box::GetRightLine() { Line l(GetRightBot(), GetRightTop()); return l; }