几何尺寸与公差论坛------致力于产品几何量公差标准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-07, 06:04 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】using Linetype Data With Opengl

using linetype data with opengl
using linetype data with opengl
hello all,
every polyline has some linetype, that should be applied to that line while displaying it. in odreadex sample project i am reading the linetype data from
void dbdumper::dumplinetypes(oddbdatabase* pdb, int indent)
the data for a specific dwg file looks like this (i have pasted the dumped data).
i am displaying the autocad objects like polylines... hatch... etc... using opengl.
my question is how can i use this data in opengl functions (like gllinestipple ..etc)
pattern name ======= byblock
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= bylayer
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= continuous
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= verdeckt
precord->patternlength= 9.525000
precord->numdashes= 2
precord->dashlengthat(0)= 6.350000
precord->dashlengthat(1)= -3.175000
pattern name ======= strichpunkt
precord->patternlength= 25.400000
precord->numdashes= 4
precord->dashlengthat(0)= 12.700000
precord->dashlengthat(1)= -6.350000
precord->dashlengthat(2)= 0.000000
precord->dashlengthat(3)= -6.350000
pattern name ======= acad_iso03w100
precord->patternlength= 30.000000
precord->numdashes= 2
precord->dashlengthat(0)= 12.000000
precord->dashlengthat(1)= -18.000000
pattern name ======= 1192
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= 1183
precord->patternlength= 3.000000
precord->numdashes= 2
precord->dashlengthat(0)= 2.000000
precord->dashlengthat(1)= -1.000000
pattern name ======= 1175
precord->patternlength= 3.000000
precord->numdashes= 2
precord->dashlengthat(0)= 2.000000
precord->dashlengthat(1)= -1.000000
pattern name ======= 1182
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= 1166
precord->patternlength= 3.000000
precord->numdashes= 2
precord->dashlengthat(0)= 2.000000
precord->dashlengthat(1)= -1.000000
pattern name ======= 1165
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= 1058
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= 8058
precord->patternlength= 0.000000
precord->numdashes= 0
pattern name ======= 2
precord->patternlength= 2.000000
precord->numdashes= 2
precord->dashlengthat(0)= 1.000000
precord->dashlengthat(1)= -1.000000
pattern name ======= verdeckt2
precord->patternlength= 4.762500
precord->numdashes= 2
precord->dashlengthat(0)= 3.175000
precord->dashlengthat(1)= -1.587500
pattern name ======= hidden
precord->patternlength= 9.525000
precord->numdashes= 2
precord->dashlengthat(0)= 6.350000
precord->dashlengthat(1)= -3.175000
pattern name ======= hidden2
precord->patternlength= 4.762500
precord->numdashes= 2
precord->dashlengthat(0)= 3.175000
precord->dashlengthat(1)= -1.587500
pattern name ======= dashdot
precord->patternlength= 25.400000
precord->numdashes= 4
precord->dashlengthat(0)= 12.700000
precord->dashlengthat(1)= -6.350000
precord->dashlengthat(2)= 0.000000
precord->dashlengthat(3)= -6.350000
pattern name ======= punkt
precord->patternlength= 6.350000
precord->numdashes= 2
precord->dashlengthat(0)= 0.000000
precord->dashlengthat(1)= -6.350000
pattern name ======= hidden4
precord->patternlength= 2.381200
precord->numdashes= 2
precord->dashlengthat(0)= 1.587500
precord->dashlengthat(1)= -0.793700

hi,
quote:
my question is how can i use this data in opengl functions (like gllinestipple ..etc)
i answer on this question in one of your previous posts sometime ago:
quote:
linetype can contain not only dots and dashes, but also shapes and text. of course, you can manually convert this array to needed form, but this convertion guarantees data lost on many linetypes.
i think impossible to convert dd linetypes representation to opengl binary form. lengths of dashes cannot be correctly converted to 16bit mask and glint multiplication factor for gllinestipple() call. i think only simplest linetypes (dots, dash-dot and etc.) with integer values can be converted, but some of them will be inaccurate.
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】meshproc and shellproc data yang686526 DirectDWG 0 2009-05-06 05:44 PM
【转帖】memory leak issue yang686526 DirectDWG 0 2009-05-06 05:37 PM
【转帖】第一课,编写第一个OpenGL程序收藏 huangyhg OpenGL图形显示 0 2009-01-21 12:10 AM
【转帖】OpenGL可视和转换 yogy OpenGL图形显示 0 2007-06-05 05:37 PM
【转帖】新手上路:JeffMolofee(NeHe)的OPENGL教程-第一课 huangyhg OpenGL图形显示 0 2007-04-28 03:22 PM


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


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