本文整理汇总了C++中Axis::GetCommonScale方法的典型用法代码示例。如果您正苦于以下问题:C++ Axis::GetCommonScale方法的具体用法?C++ Axis::GetCommonScale怎么用?C++ Axis::GetCommonScale使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Axis
的用法示例。
在下文中一共展示了Axis::GetCommonScale方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ZoomAt
//screen-to-space, done for 2D for now
void SpaceND::ZoomAt(double rx, double ry, double xfactor, double yfactor)
{
DPRINTF("ZoomAt\n");
Axis *xaxis;
Axis *yaxis;
xaxis = m_axes[0];//let x be 1st dimension
yaxis = m_axes[1];//let y be 2nd dimension
double offs, range, x, y;
range = xaxis->GetRange();
offs = xaxis->GetOffset();
x = offs + range * rx;
if (xaxis->GetCommonScale() != NULL)
{
if (xaxis->GetCommonScale()->IsInRange(range * xfactor))
{
xaxis->SetOffset(x - (x - offs) * xfactor);
xaxis->SetRange(range * xfactor);
xaxis->PropagateToCommonScale();
}
}
else
{
xaxis->SetOffset(x - (x - offs) * xfactor);
xaxis->SetRange(range * xfactor);
xaxis->PropagateToCommonScale();
}
range = yaxis->GetRange();
offs = yaxis->GetOffset();
y = offs + range * ry;
if (yaxis->GetCommonScale() != NULL)
{
if (yaxis->GetCommonScale()->IsInRange(range * yfactor))
{
yaxis->SetOffset(y - (y - offs) * yfactor);
yaxis->SetRange(range * yfactor);
yaxis->PropagateToCommonScale();
}
}
else
{
yaxis->SetOffset(y - (y - offs) * yfactor);
yaxis->SetRange(range * yfactor);
yaxis->PropagateToCommonScale();
}
}