VC++6.0 MFC AGV绘轨迹


采用VC++6.0 MFC 实现AGV绘轨迹, 调试成功 界面简洁 绘地图方便
资源截图
代码片段和文件信息
//                            - ANGLE.CPP -
//
//   Implementation of the geometric conception “angle“.
//
//   Author: Zhang Lei
//   Date:   1999. 1. 12
//
#include “stdafx.h“
#include “const.h“
#include “paintobj.h“
#include “Pnt.h“
#include 


double CAngle::m_fReso = pi/180;     // Default resolution is 1 degree.

//////////////////////////////////////////////////////////////////////////////
//   Implementation of class “CAngle“.
     
//
//   CAngle: The constructor.
//
CAngle::CAngle(double fValue int nMode)
{
// Convert into radian if neccessary
m_fRad = (nMode == IN_RADIAN) ? fValue : ToRadian(fValue);

// Normalize the angle
m_fRad = NormAngle(m_fRad);
}

//
//    Degree: Get the angle value in “degree“.
//
double CAngle::Degree()
{
return ToDegree(m_fRad);
}

//
//    Quadrant: Return the angle‘s Quadrant. (1/2/3/4).
//
int CAngle::Quadrant()
{
if (m_fRad < PI/2)                    // Quadrant 1
      return 1;
else if (m_fRad < PI)                 // Quadrant 2
      return 2;
else if (m_fRad < 3*PI/2)             // Quadrant 3
      return 3;
   else                                  // Quadrant 4
      return 4;
}

//
//   ToRadian: Convert a degree angle into a radian value.
//
double CAngle::ToRadian(double fDeg)
{
   return (PI/180) * fDeg;
}

//
//   ToDegree: Convert a radian angle into a degree value.
//
double CAngle::ToDegree(double fRad)
{
   return (180/PI) * fRad;
}

//
//    NormAngle: Normalize an radian angle into the range [0 2*PI).
//
double CAngle::NormAngle(double fRad)
{
   // Scale the angle into [0 +)
   while(fRad < 0)
      fRad += 2*PI;

   // Scale the angle into [0 2*PI)
   while (fRad >= 2*PI)
      fRad -= 2*PI;

   return fRad;
}

//
//   SetAngleReso: Set the resolution (in radian) of angle comparison.
//
double CAngle::SetReso(double fReso)
{
// Save old resolution
double fTemp = m_fReso;

// Set new resolution
m_fReso = fReso;

// Return the old reso value
return fTemp;               
}

//
//   Operator “-“: Return the negation of the angle.
//
CAngle CAngle::operator -()
{
return CAngle(-m_fRad);
}

//
//   Operator “!“: Return the reverse-directioned angle.
//
CAngle CAngle::operator !()
{
return CAngle(m_fRad + PI);
}

//
//   Operator “+“: Return the sum of 2 angles.
//
CAngle CAngle::operator +(const CAngle& Ang)
{
return CAngle(m_fRad + Ang.m_fRad);
}

//
//   Operator “-“: Return the difference of 2 angles.
//
CAngle CAngle::operator -(const CAngle& Ang)
{
return CAngle(m_fRad - Ang.m_fRad);
}

//
//   Operator “+=“: Increment of angle.
//
void CAngle::operator +=(const CAngle& Ang)
{
m_fRad = NormAngle(m_fRad + Ang.m_fRad);
}

//
//   Operator “-=“: Decrement of angle.
//
void CAngle::operator -=(const CAngle& Ang)
{
m_fRad = NormAngle(m_fRad - Ang.m_fRad);
}

//
//   Operator “==“: Test if the 2 given angles are e

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-04-05 11:16  AGV程序
     目录           0  2014-04-05 11:16  AGV程序source
     目录           0  2014-04-05 11:16  AGV程序sourcePaintobj
     文件           0  2002-07-14 16:54  AGV程序sourcePaintobj99.bin2
     文件         185  2002-07-14 16:54  AGV程序sourcePaintobj99.txt
     文件           0  2002-07-14 16:53  AGV程序sourcePaintobj11.bin1
     文件          93  2002-07-14 16:53  AGV程序sourcePaintobj11.txt
     文件           0  2002-07-14 16:51  AGV程序sourcePaintobj123.txt
     文件          56  2002-07-14 17:52  AGV程序sourcePaintobj1qa.bin1
     文件           0  2002-07-14 16:52  AGV程序sourcePaintobj231.txt
     文件          90  2002-07-14 17:52  AGV程序sourcePaintobj23523.bin2
     文件          90  2002-07-14 17:52  AGV程序sourcePaintobj39.bin2
     文件        4256  2001-05-11 09:06  AGV程序sourcePaintobjAngle.cpp
     文件        1242  2001-04-28 09:04  AGV程序sourcePaintobjArcPath.cpp
     文件        1090  2001-04-28 09:02  AGV程序sourcePaintobjArcPath.h
     文件        7384  2001-11-02 08:47  AGV程序sourcePaintobjArcattr.cpp
     文件        1574  2001-11-02 08:47  AGV程序sourcePaintobjArcattr.h
     文件        1661  2001-05-11 14:56  AGV程序sourcePaintobjBuildingArcAttrDlg.cpp
     文件        1514  2001-05-14 09:08  AGV程序sourcePaintobjBuildingArcAttrDlg.h
     文件        1311  2001-05-11 14:46  AGV程序sourcePaintobjBuildingLazysAttrDlg.cpp
     文件        1409  2001-05-15 08:17  AGV程序sourcePaintobjBuildingLazysAttrDlg.h
     文件        1382  2001-05-11 14:38  AGV程序sourcePaintobjBuildingLineAttrDlg.cpp
     文件        1426  2001-05-11 14:38  AGV程序sourcePaintobjBuildingLineAttrDlg.h
     文件         997  2000-10-13 13:50  AGV程序sourcePaintobjChangeAngle.cpp
     文件        1232  2000-08-17 08:49  AGV程序sourcePaintobjChangeAngle.h
     文件        1318  2000-10-13 13:50  AGV程序sourcePaintobjChildframe.cpp
     文件        1356  2000-09-19 16:25  AGV程序sourcePaintobjChildframe.h
     文件        2075  2001-05-15 09:58  AGV程序sourcePaintobjChordAttrDlg.cpp
     文件        1511  2001-05-15 09:58  AGV程序sourcePaintobjChordAttrDlg.h
     文件        1018  2000-12-25 09:05  AGV程序sourcePaintobjChordRadiusDlg.cpp
     文件        1268  2000-12-25 09:05  AGV程序sourcePaintobjChordRadiusDlg.h
............此处省略487个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)