本文整理汇总了C++中CCurve::GetyMax方法的典型用法代码示例。如果您正苦于以下问题:C++ CCurve::GetyMax方法的具体用法?C++ CCurve::GetyMax怎么用?C++ CCurve::GetyMax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCurve
的用法示例。
在下文中一共展示了CCurve::GetyMax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetYScale
bool Graph::SetYScale()
{
int nc;
CCurve *pCurve;
if(m_bAutoY)
{
bool bCurve = false;
if (m_oaCurves.size())
{
//init only if we have a curve
for (nc=0; nc < m_oaCurves.size(); nc++)
{
pCurve = (CCurve*)m_oaCurves[nc];
if ((pCurve->IsVisible() ||pCurve->PointsVisible()) && pCurve->n>0)
{
bCurve = true;
break;
}
}
}
if(bCurve)
{
Cymin = 9999999.0;
Cymax = -9999999.0;
for (nc=0; nc < m_oaCurves.size(); nc++)
{
pCurve = (CCurve*)m_oaCurves[nc];
if ((pCurve->IsVisible() ||pCurve->PointsVisible()) && pCurve->n>0)
{
Cymin = qMin(Cymin, pCurve->GetyMin());
Cymax = qMax(Cymax, pCurve->GetyMax());
}
}
if(Cymax<=Cymin)
{
Cymax = (Cymin+1.0)*2.0;
}
if(m_Type == 1)
{
ymin = qMin(ymin, Cymin);
ymax = qMax(ymax, Cymax);
}
else
{
ymin = Cymin;
ymax = Cymax;
}
if(Cymin>=0.0) ymin = 0.0;
if(Cymax<=0.0) ymax = 0.0;
}
else
{
// until things are made clear
for (int nc=0; nc < m_oaCurves.size(); nc++)
{
pCurve = (CCurve*)m_oaCurves[nc];
if ((pCurve->IsVisible() ||pCurve->PointsVisible()) && pCurve->n>0)
{
ymin = qMin(ymin, pCurve->y[0]);
ymax = qMax(ymax, pCurve->y[0]);
}
}
}
yo=0.0;
if (fabs((ymin-ymax)/ymin)<0.001)
{
if(fabs(ymin)<0.00001) ymax = 1.0;
else
{
ymax = 2.0 * ymin;
if(ymax < ymin)
{
double tmp = ymax;
ymax = ymin;
ymin = tmp;
}
}
}
if(m_h<=0.0) return false;
if (!m_bYInverted)
{
m_scaley = -(ymax-ymin)/m_h;
}
else
{
m_scaley = (ymax-ymin)/m_h;
}
//try to set an automatic scale for Y Axis
SetAutoYUnit();
}
else
{
//scales are set manually
if(m_h<=0) return false;
//.........这里部分代码省略.........