本文整理汇总了C++中PointPtr::Row方法的典型用法代码示例。如果您正苦于以下问题:C++ PointPtr::Row方法的具体用法?C++ PointPtr::Row怎么用?C++ PointPtr::Row使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PointPtr
的用法示例。
在下文中一共展示了PointPtr::Row方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComputeSegmentLens
float PointList::ComputeSegmentLens (float heightFactor,
float widthFactor
) const
{
if (QueueSize () < 1)
return 0.0f;
float totalLen = 0.0f;
const_iterator idx;
idx = begin ();
PointPtr lastPoint = *idx;
++idx;
while (idx != end ())
{
PointPtr nextPoint = *idx; ++idx;
float deltaHeight = (float)(nextPoint->Row () - lastPoint->Row ()) * heightFactor;
float deltaWidth = (float)(nextPoint->Col () - lastPoint->Col ()) * widthFactor;
float segmentLen = sqrt (deltaHeight * deltaHeight + deltaWidth * deltaWidth);
totalLen += segmentLen;
lastPoint = nextPoint;
}
return totalLen;
} /* ComputeSegmentLens */
示例2: BoxCoordinites
void PointList::BoxCoordinites (kkint32& minRow,
kkint32& minCol,
kkint32& maxRow,
kkint32& maxCol
)
{
minRow = minCol = 999999;
maxRow = maxCol = -1;
for (iterator x = begin (); x != end (); x++)
{
PointPtr p = *x;
if (p->Row () < minRow)
minRow = p->Row ();
if (p->Row () > maxRow)
maxRow = p->Row ();
if (p->Col () < minCol)
minCol = p->Col ();
if (p->Col () > maxCol)
maxCol = p->Col ();
}
}
示例3: CalculateCenterPoint
Point PointList::CalculateCenterPoint ()
{
kkint32 totalRow = 0;
kkint32 totalCol = 0;
for (iterator x = begin (); x != end (); x++)
{
PointPtr p = *x;
totalRow += p->Row ();
totalCol += p->Col ();
}
kkint32 centerRow = (kkint32)((double)totalRow / (double)size () + 0.5);
kkint32 centerCol = (kkint32)((double)totalCol / (double)size () + 0.5);
return Point (centerRow, centerCol);
}
示例4: ToDelStr
KKStr PointList::ToDelStr (char del) const
{
if (QueueSize () < 1)
return "[]";
KKStr result (QueueSize () * 10);
int count = 0;
PointList::const_iterator idx;
for (idx = begin (); idx != end (); ++idx, ++count)
{
PointPtr p = *idx;
if (count > 0)
result << del;
result << p->Row () << del << p->Col ();
}
return result;
} /* ToDelStr */