备录

来源:互联网 发布:不喜欢粗人知乎 编辑:程序博客网 时间:2024/04/23 15:23

CPoint CDrawtestView::fun( CPoint ptCenter, int iRadius, int iInterval ,int idirect ,int iFlag)
{
 if( iFlag ==-1)
 {
  int Temp = ptCenter.x;
  ptCenter.x = ptCenter.y;
  ptCenter.y = Temp;
 }
 for(int i = 1; true; i++)
 {
  double iTempRadius = iRadius * i;//y de cha ju
  double origin_x = ptCenter.x - MAX_LENGTH/2;
  double iTempInterval =(double)MAX_LENGTH/(double)(iInterval-1);

  CPoint TempPoint;
  for( double j = 0; j<=MAX_LENGTH;j+=iTempInterval)
  {
   TempPoint.x = origin_x + j+0.5;
   TempPoint.y = ptCenter.y + idirect*(iTempRadius+0.5);
   if( iFlag ==-1)
   {
    int Temp = TempPoint.x;
    TempPoint.x = TempPoint.y;
    TempPoint.y = Temp;
   }
   vector<CRect* >::iterator it = m_vcRect.begin();
   for(;it!=m_vcRect.end();++it)
   {
    if( (*it)->PtInRect(TempPoint))
     break;
   }
   if( it == m_vcRect.end())
    return TempPoint;
  }
 }
  return ptCenter;

原创粉丝点击