几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   ObjectARX(C++) (http://www.dimcax.com/hust/forumdisplay.php?f=34)
-   -   调用函数的问题(两点坐标相同时) (http://www.dimcax.com/hust/showthread.php?t=8287)

yang686526 2009-04-18 10:34 PM

调用函数的问题(两点坐标相同时)
 
调用函数的问题(两点坐标相同时)
调用函数的问题(两点坐标相同时)
如何调用函数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[i]),"\n 下一点:",asdblarray(bpt[i+1]));
k= equal_points(asdblarray(bpt[1]),asdblarray(bpt[i+1]));//如果屏蔽该句则没问题
//请问这样调用会出错,应该怎样改?
}
.........
}
可这样调用总是出错:
attribute.obj : error lnk1: unresolved external symbol "public: int __thiscall
cattribute::equal_points(double const * const,double const * const)"
这里面还存在问题:const ads_point p1 ;好象不能使用
acgepoint3d bpt[65];定义的坐标?
你可能要解决负0问题, 注意 -0!=0 。


所有的时间均为北京时间。 现在的时间是 10:17 AM.