当前位置: 首页>>代码示例>>C++>>正文


C++ PointPtr::Row方法代码示例

本文整理汇总了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 */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:29,代码来源:Point.cpp

示例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 ();
  }
}
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:25,代码来源:Point.cpp

示例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);
}
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:15,代码来源:Point.cpp

示例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 */
开发者ID:KurtKramer,项目名称:KSquareLibraries,代码行数:18,代码来源:Point.cpp


注:本文中的PointPtr::Row方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。