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


返回   几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 » 仿射空间:CAX软件开发(三)二次开发与程序设计 » CAD二次开发 » AutoCAD二次开发 » DirectDWG
用户名
密码
注册 帮助 会员 日历 银行 搜索 今日新帖 标记论坛为已读


回复
 
主题工具 搜索本主题 显示模式
旧 2009-05-05, 11:12 AM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】geometry issue

geometry issue
geometry issue
hi,
in objectarx we had several very useful functions: like this one:
inline double* asdblarray(const acgevector2d&);
we could use it in cases where array of 3 doubles were used. is this something like these in the dwg toolkit or can someone place them for the next release? of course we can use something like (&vec.x) for array but i'm not sure how afety it is.
regards
chudomir
best regards
chudomir

i'd prefer if you use your own definitions like
inline double * asdblarray(odgepoint2d & pt)
{return &pt.x;}
if we include them into common interface we need to be sure that it works correctly on all supported platforms.
sergey slezkin

ok, no problem. but the classes odgepoint2d/3d etc miss the #pragma pack(n) directive as in objectarx files. can this cause problems?
thanks.
chudomir delchev
best regards
chudomir

you are right that dwgdirect public headers must contain:
#pragma pack(push, ...)
....
#pragma pack(pop)
else client project can't have alignment different from one used while compiling dwgdirect.
but even without them problems with asdblarray can happen only if you use #pragma pack(16) in your project.
sergey slezkin

thanks for the info.
and here is a sample header for these, but i have no time to test them. anyway i thinke they should work:
[code]
#ifndef geassign_h
#define geassign_h
#pragma pack (push, 8)
class odgepoint2d;
class odgevector2d;
class odgepoint3d;
class odgevector3d;
inline odgepoint2d& aspnt2d(const double* pnt) {
return *((odgepoint2d*)pnt);
}
inline odgevector2d& asvec2d(const double* vec) {
return *((odgevector2d*)vec);
}
inline double* asdblarray(const odgepoint2d& pnt) {
return (double*)&pnt;
}
inline double* asdblarray(const odgevector2d& vec) {
return (double*)&vec;
}
inline odgepoint3d& aspnt3d(const double* pnt) {
return *((odgepoint3d*)pnt);
}
inline odgevector3d& asvec3d(const double* vec) {
return *((odgevector3d*)vec);
}
inline double* asdblarray(const odgepoint3d& pnt) {
return (double*)&pnt;
}
inline double* asdblarray(const odgevector3d& vec) {
return (double*)&vec;
}
#pragma pack (pop)
#endif
</pre><hr></blockquote>
best regards
chudomir

not sure that #pragma pack (push, 8) would compile on all dwgdirect-supported platforms...
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
回复


主题工具 搜索本主题
搜索本主题:

高级搜索
显示模式

发帖规则
不可以发表新主题
不可以回复主题
不可以上传附件
不可以编辑您的帖子

vB 代码开启
[IMG]代码开启
HTML代码关闭

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】explode or explodegeometry issue with 3dsolids and bodys yang686526 DirectDWG 0 2009-05-05 10:08 AM
【转帖】circle and arc rendering issue yang686526 DirectDWG 0 2009-05-04 05:46 PM
【转帖】an explode issue yang686526 DirectDWG 0 2009-05-04 03:58 PM
【转帖】3d view issue yang686526 DirectDWG 0 2009-05-04 03:03 PM
【转帖】insert new sheet issue yang686526 SolidWorks二次开发 0 2009-04-13 12:16 PM


所有的时间均为北京时间。 现在的时间是 01:12 PM.


于2004年创办,几何尺寸与公差论坛"致力于产品几何量公差标准GD&T | GPS研究/CAD设计/CAM加工/CMM测量"。免责声明:论坛严禁发布色情反动言论及有关违反国家法律法规内容!情节严重者提供其IP,并配合相关部门进行严厉查处,若內容有涉及侵权,请立即联系我们QQ:44671734。注:此论坛须管理员验证方可发帖。
沪ICP备06057009号-2
更多