Exemplo n.º 1
0
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);
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
Line Box::GetTopLine()
{
	Line l(GetRightTop(), GetLeftTop());
	return l;
}
Exemplo n.º 4
0
Line Box::GetRightLine()
{
	Line l(GetRightBot(), GetRightTop());
	return l;
}