本文整理汇总了C++中CCurve::GetxMin方法的典型用法代码示例。如果您正苦于以下问题:C++ CCurve::GetxMin方法的具体用法?C++ CCurve::GetxMin怎么用?C++ CCurve::GetxMin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCurve
的用法示例。
在下文中一共展示了CCurve::GetxMin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetXScale
bool Graph::SetXScale()
{
CCurve *pCurve;
int nc;
if(m_bAutoX)
{
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>1)
{
bCurve = true;
break;//there is something to draw
}
}
}
if (bCurve)
{
Cxmin = 9999999.0;
Cxmax = -9999999.0;
for (nc=0; nc < m_oaCurves.size(); nc++)
{
pCurve = (CCurve*)m_oaCurves[nc];
if ((pCurve->IsVisible() ||pCurve->PointsVisible()) && pCurve->n>0)
{
Cxmin = qMin(Cxmin, pCurve->GetxMin());
Cxmax = qMax(Cxmax, pCurve->GetxMax());
}
}
if(Cxmax<=Cxmin)
Cxmax = (Cxmin+1.0)*2.0;
if(m_Type == 1)
{
xmin = qMin(xmin, Cxmin);
xmax = qMax(xmax, Cxmax);
}
else
{
xmin = Cxmin;
xmax = Cxmax;
}
if(Cxmin>=0.0) xmin = 0.0;
if(Cxmax<=0.0) xmax = 0.0;
}
else
{
// until things are made clear
for (nc=0; nc < m_oaCurves.size(); nc++)
{
pCurve = (CCurve*)m_oaCurves[nc];
if ((pCurve->IsVisible() ||pCurve->PointsVisible()) && pCurve->n>0)
{
xmin = qMin(xmin, pCurve->x[0]);
xmax = qMax(xmax, pCurve->x[0]);
}
}
}
xo=0.0;
if(fabs((xmin-xmax)/xmin)<0.001)
{
if(fabs(xmin)<0.00001) xmax = 1.0;
else
{
xmax = 2.0 * xmin;
if(xmax < xmin)
{
double tmp = xmax;
xmax = xmin;
xmin = tmp;
}
}
}
if(m_w<=0.0) return false;
m_scalex = (xmax-xmin)/m_w;
//try to set an automatic scale for X Axis
SetAutoXUnit();
}
else
{
//scales are set manually
if(m_w<=0.0) return false;
// m_scalex = (xmax-xmin)/m_w;
if (xunit<1.0)
{
//.........这里部分代码省略.........