- UID
- 306377
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-8-10
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
调用函数的问题(两点坐标相同时)
如何调用函数Equal_Points的问题:
在Attribute.h中:
class CAttribute : public CDialog
{
// Construction
public:
int Equal_Points (const ads_point p1, const ads_point p2);/
.............
在Attribute.cpp中我的代码:
int Equal_Points(const ads_point p1, const ads_point p2) //判断两点坐标p1,p2是否相等
{
// 指定误差范围
const ads_real Equality_Margin = (ads_real)0.00000001;
int c ;
for (c = X ; c <= Z ; c++) {
float ee=p1[c] - p2[c];
if(fabs(ee) > Equality_Margin) { //(fabs(p1[c] - p2[c]) > Equality_Margin) {
return (0) ;
}
}
return (1) ;
}
我在Attribute.cpp下面的函数这样调用:
void CAttribute::OnLine() //编 辑void CAttribute::OnLine() 函 数
{ AcGePoint3d BPt[65];
int k=0;
ads_getpoint(NULL,"\n 第一点:",asDblArray(BPt[1]));
for (i=1; k==1 ;i++) //当两点坐标相等时跳出循环
{
ads_getpoint(asDblArray(BPt),"\n 下一点:",asDblArray(BPt[i+1]));
k= Equal_Points(asDblArray(BPt[1]),asDblArray(BPt[i+1]));//如果屏蔽该句则没问题
//请问这样调用会出错,应该怎样改?
}
.........
}
可这样调用总是出错:
Attribute.obj : error LNK2001: unresolved external symbol "public: int __thiscall
CAttribute::Equal_Points(double const * const,double const * const)"
(?Equal_Points@CAttribute@@QAEHQBN0@Z)
这里面还存在问题:const ads_point p1 ;好象不能使用
AcGePoint3d BPt[65];定义的坐标? |
|