本文整理汇总了C++中m2::RectD::RightBottom方法的典型用法代码示例。如果您正苦于以下问题:C++ RectD::RightBottom方法的具体用法?C++ RectD::RightBottom怎么用?C++ RectD::RightBottom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类m2::RectD
的用法示例。
在下文中一共展示了RectD::RightBottom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GtoP
void ScreenBase::GtoP(m2::RectD const & glbRect, m2::RectD & pxRect) const
{
pxRect = m2::RectD(GtoP(glbRect.LeftTop()), GtoP(glbRect.RightBottom()));
}
示例2: PtoG
void ScreenBase::PtoG(m2::RectD const & pxRect, m2::RectD & glbRect) const
{
glbRect = m2::RectD(PtoG(pxRect.LeftTop()), PtoG(pxRect.RightBottom()));
}
示例3: ClipTriangleByRect
void ClipTriangleByRect(m2::RectD const & rect, m2::PointD const & p1,
m2::PointD const & p2, m2::PointD const & p3,
ClipTriangleByRectResultIt const & resultIterator)
{
if (resultIterator == nullptr)
return;
if (rect.IsPointInside(p1) && rect.IsPointInside(p2) && rect.IsPointInside(p3))
{
resultIterator(p1, p2, p3);
return;
}
const double kEps = 1e-8;
vector<m2::PointD> poligon;
auto const addPoligonPoint = [&poligon, kEps](m2::PointD const & pt)
{
if (poligon.empty() || !poligon.back().EqualDxDy(pt, kEps))
poligon.push_back(pt);
};
vector<m2::PointD> const corners = { rect.LeftTop(), rect.RightTop(), rect.RightBottom(), rect.LeftBottom() };
int firstClipCode[3];
int lastClipCode[3];
bool intersected[3];
intersected[0] = IntersectEdge(rect, corners, p1, p2, p3, addPoligonPoint,
0, 0, firstClipCode[0], lastClipCode[0]);
intersected[1] = IntersectEdge(rect, corners, p2, p3, p1, addPoligonPoint,
lastClipCode[0], 0, firstClipCode[1], lastClipCode[1]);
intersected[2] = IntersectEdge(rect, corners, p3, p1, p2, addPoligonPoint,
lastClipCode[1] != 0 ? lastClipCode[1] : lastClipCode[0],
firstClipCode[0] != 0 ? firstClipCode[0] : firstClipCode[1],
firstClipCode[2], lastClipCode[2]);
int const intersectCount = intersected[0] + intersected[1] + intersected[2];
if (intersectCount == 0)
{
if (IsPointInsideTriangle(rect.Center(), p1, p2, p3))
{
resultIterator(rect.LeftTop(), rect.RightTop(), rect.RightBottom());
resultIterator(rect.RightBottom(), rect.LeftBottom(), rect.LeftTop());
}
return;
}
if (intersectCount == 1 && intersected[2])
InsertCorners(corners, p1, p2, p3, addPoligonPoint, lastClipCode[2], firstClipCode[2]);
if (!poligon.empty() && poligon.back().EqualDxDy(poligon[0], kEps))
poligon.pop_back();
if (poligon.size() < 3)
return;
for (size_t i = 0; i < poligon.size() - 2; ++i)
resultIterator(poligon[0], poligon[i + 1], poligon[i + 2]);
}