当前位置: 首页>>代码示例>>C++>>正文


C++ Axis::SetOffset方法代码示例

本文整理汇总了C++中Axis::SetOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ Axis::SetOffset方法的具体用法?C++ Axis::SetOffset怎么用?C++ Axis::SetOffset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Axis的用法示例。


在下文中一共展示了Axis::SetOffset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProceedPanAt

void SpaceND::ProceedPanAt(double rx, double ry)
{
    DPRINTF("SpaceND::ProceedPanAt\n");

    Axis *xaxis;
    Axis *yaxis;
    xaxis = m_axes[AXIS_X];//let x be 1st dimension
    yaxis = m_axes[AXIS_Y];//let y be 2nd dimension


//TO DO: need to review this code
    if (xaxis != NULL)
    {
        xaxis->SetOffset(m_pan_start_at_vx - xaxis->GetRange() * (rx - m_pan_start_at_rx));
        xaxis->PropagateToCommonScale();
    }


    if (yaxis != NULL)
    {
        yaxis->SetOffset(m_pan_start_at_vy - yaxis->GetRange() * (ry - m_pan_start_at_ry));
        yaxis->PropagateToCommonScale();
    }

}
开发者ID:ainur-giniyatov,项目名称:wxPlot,代码行数:25,代码来源:Space.cpp

示例2: 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();
    }

}
开发者ID:ainur-giniyatov,项目名称:wxPlot,代码行数:49,代码来源:Space.cpp

示例3: ZoomSelection

void SpaceND::ZoomSelection(double start_rx, double start_ry, double end_rx, double end_ry)
{
    DPRINTF("SpaceND::ZoomSelection\n");

    Axis *xaxis;
    Axis *yaxis;
    xaxis = m_axes[AXIS_X]; //let x be 1st dimension
    yaxis = m_axes[AXIS_Y]; //let y be 2nd dimension
    
    double temp;
    temp = start_rx;
    if (start_rx > end_rx)
    {
        start_rx = end_rx;
        end_rx = temp;
    }
    
    temp = start_ry;
    if (start_ry > end_ry)
    {
        start_ry = end_ry;
        end_ry = temp;
    }
    
    //TO DO: need to review this code
    if (xaxis != NULL)
    {
        //xaxis->SetOffset(m_pan_start_at_vx - xaxis->GetRange() * (rx - m_pan_start_at_rx));
        xaxis->SetOffset(xaxis->GetOffset() + xaxis->GetRange() * start_rx);
        xaxis->SetRange(xaxis->GetRange() * (end_rx - start_rx));
        xaxis->PropagateToCommonScale();
    }


    if (yaxis != NULL)
    {
        //yaxis->SetOffset(m_pan_start_at_vy - yaxis->GetRange() * (ry - m_pan_start_at_ry));
        yaxis->SetOffset(yaxis->GetOffset() + yaxis->GetRange() * start_ry);
        yaxis->SetRange(yaxis->GetRange() * (end_ry - start_ry));
        yaxis->PropagateToCommonScale();
    }
}
开发者ID:ainur-giniyatov,项目名称:wxPlot,代码行数:42,代码来源:Space.cpp


注:本文中的Axis::SetOffset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。