本文整理汇总了C++中CLine::GetCount方法的典型用法代码示例。如果您正苦于以下问题:C++ CLine::GetCount方法的具体用法?C++ CLine::GetCount怎么用?C++ CLine::GetCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CLine
的用法示例。
在下文中一共展示了CLine::GetCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _AddPathPortion
void COptimizePath::_AddPathPortion(CLine& line, const A3DPOINT2& dest, const int newCount)
{
int index;
int old_count = 0;
for (index = m_CurIndex +1; index < (int)m_Path.size(); index++)
{
old_count++;
//clear the old footprint
int x, y;
x = (int)m_Path[index].x;
y = (int)m_Path[index].y;
SetFootprint(x, y, 0);
if (x == dest.x && y == dest.y)
{
break;
}
}
assert(index < (int)m_Path.size() );
//adjust the path space between current to dest, have old_count, need newCount
if (old_count > newCount)
{
//erase
abase::vector<APointF>::iterator it1, it2;
it1 = &m_Path[m_CurIndex+1];
it2 = it1 + old_count - newCount;
m_Path.erase(it1, it2);
}
else if (old_count < newCount)
{
//insert
abase::vector<APointF>::iterator it1;
it1 = &m_Path[m_CurIndex+1];
m_Path.insert(it1, newCount - old_count, APointF());
}
//replace the old path portion
index = m_CurIndex+1;
while (line.GetCount() < newCount)
{
m_Path[index] = line.Next();
index++;
}
}