本文整理汇总了C++中m2::RectD::SizeX方法的典型用法代码示例。如果您正苦于以下问题:C++ RectD::SizeX方法的具体用法?C++ RectD::SizeX怎么用?C++ RectD::SizeX使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类m2::RectD
的用法示例。
在下文中一共展示了RectD::SizeX方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTileScaleBase
int GetTileScaleBase(m2::RectD const & r)
{
double const sz = max(r.SizeX(), r.SizeY());
return max(1, my::rounds(log((MercatorBounds::maxX - MercatorBounds::minX) / sz) / log(2.0)));
}
示例2: empty_scr_rect
static bool empty_scr_rect(m2::RectD const & r)
{
double const eps = 1.0;
return (r.SizeX() < eps && r.SizeY() < eps);
}
示例3: CanShrinkInto
bool CanShrinkInto(ScreenBase const & screen, m2::RectD const & boundRect)
{
m2::RectD clipRect = screen.ClipRect();
return (boundRect.SizeX() >= clipRect.SizeX())
&& (boundRect.SizeY() >= clipRect.SizeY());
}
示例4: CalculateScale
double CalculateScale(m2::RectD const & pixelRect, m2::RectD const & localRect)
{
return max(localRect.SizeX() / pixelRect.SizeX(), localRect.SizeY() / pixelRect.SizeY());
}
示例5: ShrinkAndScaleInto
ScreenBase const ShrinkAndScaleInto(ScreenBase const & screen, m2::RectD boundRect)
{
ReduceRectHack(boundRect);
ScreenBase res = screen;
m2::RectD globalRect = res.ClipRect();
m2::PointD newOrg = res.GetOrg();
double scale = 1;
double offs = 0;
if (globalRect.minX() < boundRect.minX())
{
offs = boundRect.minX() - globalRect.minX();
globalRect.Offset(offs, 0);
newOrg.x += offs;
if (globalRect.maxX() > boundRect.maxX())
{
double k = boundRect.SizeX() / globalRect.SizeX();
scale /= k;
/// scaling always occur pinpointed to the rect center...
globalRect.Scale(k);
/// ...so we should shift a rect after scale
globalRect.Offset(boundRect.minX() - globalRect.minX(), 0);
}
}
if (globalRect.maxX() > boundRect.maxX())
{
offs = boundRect.maxX() - globalRect.maxX();
globalRect.Offset(offs, 0);
newOrg.x += offs;
if (globalRect.minX() < boundRect.minX())
{
double k = boundRect.SizeX() / globalRect.SizeX();
scale /= k;
globalRect.Scale(k);
globalRect.Offset(boundRect.maxX() - globalRect.maxX(), 0);
}
}
if (globalRect.minY() < boundRect.minY())
{
offs = boundRect.minY() - globalRect.minY();
globalRect.Offset(0, offs);
newOrg.y += offs;
if (globalRect.maxY() > boundRect.maxY())
{
double k = boundRect.SizeY() / globalRect.SizeY();
scale /= k;
globalRect.Scale(k);
globalRect.Offset(0, boundRect.minY() - globalRect.minY());
}
}
if (globalRect.maxY() > boundRect.maxY())
{
offs = boundRect.maxY() - globalRect.maxY();
globalRect.Offset(0, offs);
newOrg.y += offs;
if (globalRect.minY() < boundRect.minY())
{
double k = boundRect.SizeY() / globalRect.SizeY();
scale /= k;
globalRect.Scale(k);
globalRect.Offset(0, boundRect.maxY() - globalRect.maxY());
}
}
res.SetOrg(globalRect.Center());
res.Scale(scale);
return res;
}
示例6: Move
void Navigator::Move(double azDir, double factor)
{
m2::RectD const r = m_Screen.ClipRect();
m_Screen.MoveG(m2::PointD(r.SizeX() * factor * cos(azDir), r.SizeY() * factor * sin(azDir)));
}
示例7: CalculateScale
double CalculateScale(ScreenBase const & screen, m2::RectD const & localRect)
{
m2::RectD const pixelRect = screen.PixelRect();
return max(localRect.SizeX() / pixelRect.SizeX(), localRect.SizeY() / pixelRect.SizeY());
}