本文整理汇总了C++中CBCGPRect::SetRectEmpty方法的典型用法代码示例。如果您正苦于以下问题:C++ CBCGPRect::SetRectEmpty方法的具体用法?C++ CBCGPRect::SetRectEmpty怎么用?C++ CBCGPRect::SetRectEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBCGPRect
的用法示例。
在下文中一共展示了CBCGPRect::SetRectEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRangeShape
//*******************************************************************************
BOOL CBCGPLinearGaugeImpl::GetRangeShape(CBCGPRect& rect, CBCGPPolygonGeometry& shape, double dblStartValue, double dblFinishValue,
double dblStartWidth, double dblFinishWidth,
double dblOffsetFromFrame, int nScale)
{
rect.SetRectEmpty();
shape.Clear();
CBCGPPoint pt1;
if (!ValueToPoint(dblStartValue, pt1, nScale))
{
return FALSE;
}
CBCGPPoint pt2;
if (!ValueToPoint(dblFinishValue, pt2, nScale))
{
return FALSE;
}
const double scaleRatio = GetScaleRatioMid();
if (dblStartWidth == 0.)
{
CBCGPGaugeScaleObject* pScale = GetScale(nScale);
if (pScale != NULL)
{
dblStartWidth = pScale->m_dblMajorTickMarkSize + pScale->m_dblOffsetFromFrame;
}
}
if (dblFinishWidth == 0.)
{
dblFinishWidth = dblStartWidth;
}
dblStartWidth *= scaleRatio;
dblFinishWidth *= scaleRatio;
dblOffsetFromFrame *= scaleRatio;
if (dblFinishWidth == dblStartWidth)
{
if (m_bIsVertical)
{
rect.left = pt1.x + dblOffsetFromFrame;
rect.top = pt1.y;
rect.right = pt1.x + dblStartWidth + dblOffsetFromFrame;
rect.bottom = pt2.y;
}
else
{
rect.left = pt1.x;
rect.top = pt1.y + dblOffsetFromFrame;
rect.right = pt2.x;
rect.bottom = pt1.y + dblStartWidth + dblOffsetFromFrame;
}
}
else
{
CBCGPPointsArray arPoints;
if (m_bIsVertical)
{
arPoints.Add(CBCGPPoint(pt1.x + dblOffsetFromFrame, pt1.y));
arPoints.Add(CBCGPPoint(pt2.x + dblOffsetFromFrame, pt2.y));
arPoints.Add(CBCGPPoint(pt2.x + dblOffsetFromFrame + dblFinishWidth, pt2.y));
arPoints.Add(CBCGPPoint(pt1.x + dblOffsetFromFrame + dblStartWidth, pt1.y));
}
else
{
arPoints.Add(CBCGPPoint(pt1.x, pt1.y + dblOffsetFromFrame));
arPoints.Add(CBCGPPoint(pt2.x, pt2.y + dblOffsetFromFrame));
arPoints.Add(CBCGPPoint(pt2.x, pt2.y + dblOffsetFromFrame + dblFinishWidth));
arPoints.Add(CBCGPPoint(pt1.x, pt1.y + dblOffsetFromFrame + dblStartWidth));
}
shape.SetPoints(arPoints);
}
return TRUE;
}