本文整理汇总了C++中Rect::GetBottom方法的典型用法代码示例。如果您正苦于以下问题:C++ Rect::GetBottom方法的具体用法?C++ Rect::GetBottom怎么用?C++ Rect::GetBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Rect
的用法示例。
在下文中一共展示了Rect::GetBottom方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IntersectsWithRect
BOOL CArcView::IntersectsWithRect(const Rect& rectangle)
{
Point topLeft(rectangle.GetLeft(), rectangle.GetTop());
Point topRight(rectangle.GetRight(), rectangle.GetTop());
Point bottomLeft(rectangle.GetLeft(), rectangle.GetBottom());
Point bottomRight(rectangle.GetRight(), rectangle.GetBottom());
Point currentPoint(*pathPoints.begin());
for(auto it=pathPoints.begin() + 1; it != pathPoints.end(); ++it)
{
if(rectangle.Contains(currentPoint))
return TRUE;
if(Geometry::LinesIntersect(topLeft, topRight, currentPoint, *it))
return TRUE;
if(Geometry::LinesIntersect(topLeft, bottomLeft, currentPoint, *it))
return TRUE;
if(Geometry::LinesIntersect(bottomLeft, bottomRight, currentPoint, *it))
return TRUE;
if(Geometry::LinesIntersect(topRight, bottomRight, currentPoint, *it))
return TRUE;
currentPoint = *it;
}
return FALSE;
}
示例2: Intersects
bool Rect::Intersects(Rect box)
{
if(right < box.GetLeft() || left > box.GetRight() ||
top > box.GetBottom() || bottom < box.GetTop())
return false;
else
return true;
}
示例3: IntersectsWithRect
BOOL CCircleView::IntersectsWithRect(const Rect& rectangle)
{
Point center(position);
double edgeCenterDistance = INT_MAX;
std::vector<Point> rectCorners;
Point topLeft(rectangle.GetLeft(), rectangle.GetTop());
Point topRight(rectangle.GetRight(), rectangle.GetTop());
Point bottomLeft(rectangle.GetLeft(), rectangle.GetBottom());
Point bottomRight(rectangle.GetRight(), rectangle.GetBottom());
rectCorners.push_back(topLeft);
rectCorners.push_back(topRight);
rectCorners.push_back(bottomLeft);
rectCorners.push_back(bottomRight);
//Le centre du cercle est-il dans le rectangle ?
if(rectangle.Contains(center)) return TRUE;
//Un coin du rectangle est-il dans le cercle ?
for(auto it=rectCorners.begin(); it!=rectCorners.end(); ++it)
if(Geometry::Distance(*it, center) < radius) return TRUE;
//Un côté du rectangle coupe-t-il dans le cercle ?
if(topLeft.X < center.X && center.X < topRight.X
&& Geometry::LinePointDistance(topLeft, topRight, center) < radius)
return TRUE;
if(topLeft.Y < center.Y && center.Y < bottomLeft.Y
&& Geometry::LinePointDistance(topLeft, bottomLeft, center) < radius)
return TRUE;
if(bottomLeft.X < center.X && center.X < bottomRight.X
&& Geometry::LinePointDistance(bottomLeft, bottomRight, center) < radius)
return TRUE;
if(topRight.Y < center.Y && center.Y < bottomRight.Y
&& Geometry::LinePointDistance(topRight, bottomRight, center) < radius)
return TRUE;
return FALSE;
}
示例4: UpdateLayoutPost
virtual void UpdateLayoutPost(Graphics& g, const Rect& layout) {
FlowLayout l(layout, g_theme->sz_margin);
l.Add(el_text, FlowLayout::Left)
.LineBreak();
Rect r = l.GetInsertRect();
LayoutOutlineChildren(g, r);
l.InsertRect(r);
r = l.GetBounds();
extents.Width = r.GetRight();
extents.Height = r.GetBottom();
}
示例5: DrawBevel
/*
** Draws a bevel inside the given area
*/
void Meter::DrawBevel(Graphics& graphics, const Rect& rect, const Pen& light, const Pen& dark)
{
int l = rect.GetLeft();
int r = rect.GetRight() - 1;
int t = rect.GetTop();
int b = rect.GetBottom() - 1;
graphics.DrawLine(&light, l, t, l, b);
graphics.DrawLine(&light, l, t, r, t);
graphics.DrawLine(&light, l + 1, t + 1, l + 1, b - 1);
graphics.DrawLine(&light, l + 1, t + 1, r - 1, t + 1);
graphics.DrawLine(&dark, l, b, r, b);
graphics.DrawLine(&dark, r, t, r, b);
graphics.DrawLine(&dark, l + 1, b - 1, r - 1, b - 1);
graphics.DrawLine(&dark, r - 1, t + 1, r - 1, b - 1);
}