uusky 发表于 2005-9-26 15:22:00

[ARX]请问AcGePoint3d 与const ads_point 该如何转换

<P>请教一个问题:</P>
<P>&nbsp;AcGePoint3d pt ,我现在存在两个坐标:</P>
<P>现在要比较AcGePoint3d pt 与AcGePoint3d pt 是否是同一个点!以便确定画图结束!</P>
<P>可是总是出错:</P>
<P>error C2664: 'Equal_Points' : cannot convert parameter 1 from 'class AcGePoint3d' to 'const double []'</P>
<P>请问AcGePoint3d 与const ads_point 该如何转换才好!</P>
<P>调用以下函数:</P>
<P>int Equal_Points (const ads_point p1, const ads_point p2) <BR>{<BR>&nbsp;&nbsp;&nbsp; // 指定误差范围<BR>&nbsp;&nbsp;&nbsp; const ads_real Equality_Margin = (ads_real)0.00000001; <BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; int c ;<BR>&nbsp;&nbsp;&nbsp; for (c = X ; c &lt;= Z ; c++) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (fabs(p1 - p2) &gt; Equality_Margin) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return (0) ;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; return (1) ;<BR>}</P>

uusky 发表于 2005-9-26 15:46:00

问题解决:<BR>之前有过类似的帖子,权当再学习一下吧!:)<BR>void changepoint(ads_point&amp; ads_pt,AcGePoint3d acge_pt)<BR>{ <BR>&nbsp;double x=acge_pt; <BR>&nbsp;double y=acge_pt; <BR>&nbsp;double z=acge_pt;<BR>&nbsp;ads_pt=x; <BR>&nbsp;ads_pt=y; <BR>&nbsp;ads_pt=z; <BR>}<BR>

glhu3 发表于 2005-10-16 17:26:00

<P>从AcGePoint3d转换到ads_point函数如下:</P>
<P>ads_point&nbsp;ChangePtFrom3dToAds(AcGePoint3d pt)</P>
<P>{</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; ads_point adspt;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;adspt=pt.x;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; adspt=pt.y;</P>
<P>&nbsp;&nbsp;&nbsp; adspt=pt.z;</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp; return adspt;&nbsp;</P>
<P>}</P>
页: [1]
查看完整版本: [ARX]请问AcGePoint3d 与const ads_point 该如何转换