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

text with shx font by polylines
text with shx font by polylines
we hav ean application that already manages ttf fonts.
now, i would like to explode a text written with an shx font
to polylines. the only way i found is to use
textproc function.
so, lloking to this forum and to the manual, what i do is:
class mygeometrysimplifier : public odgigeometrysimplifier
{
public:
void polylineproc(odint32 nbpoints,
const odgepoint3d* pvertexlist,
const odgevector3d* ,
const odgevector3d* pextrusion,
odint32 );
};
odgitextstyle gistyle;
gifromdbtextstyle(ptext->textstyle(), gistyle);
gistyle.settextsize(ptext->height());
gistyle.setxscale(ptext->widthfactor());
gistyle.setobliquingangle(ptext->oblique());
odstring strtxt = ptext->textstring();
const odchar *pstrmsg = strtxt.c_str();
odint32 ilen = strtxt.getlength();
odgevector3d normal = ptext->normal();
double dangle = ptext->rotation();
odgevector3d direction;
direction.rotateby(dangle, odgevector3d::kzaxis);
direction.transformby(odgematrix3d:: planetoworld(normal));
odgepoint3d position = ptext->position();
mygeometrysimplifier geom;
geom.setdrawcontext(odgibasevectorizer::drawcontex t());
geom.textproc(position, normal, direction, pstrmsg, ilen, true, &gistyle);
the function
geom.setdrawcontext(odgibasevectorizer::drawcontex t());
gives me an error of overload during compilation.
what can i do?
i am not so skilled in opendwg and any help on how to represent a shx text by polylines will be very well accepted.
thank you in advance.
fede
can you be more specific please: what you have and what you want to get?
what is "ptext" in the code you cited?
in what context this code is executed?
how odgibasevectorizer relates to this context?
vladimir
quote:
originally posted by wvk
can you be more specific please: what you have and what you want to get?
what is "ptext" in the code you cited?
in what context this code is executed?
how odgibasevectorizer relates to this context?
sorry vladimir,
as i wrote i am not so skilled in opendwg.
we have a software application to transform dxf files in cnc programs for
automatic machine. this machine works only with lines and arcs.
i have ptext that is a oddbtextptr.
my target is to obtain the polylines describing the text pointed by ptext.
at the moment by windows api we can obtain the points describing
the true type font pointed by ptext.
i would like to obtain a similar thing also with shf fonts.
so at first i have searched for an shx file format description but i have found nothing that could help me.
i have found on this forum a similar question and so i tried to use it but, as i told, i am not skilled in opendwg.
we don't use till now odgibasevectorizer.
so my question is: starting from my current status, how can i obtain the polylines describing the text?
i thank you in advance.
bye,
ft
vectorizing device may be inherited from odgibasevectorizer.
code:
#include "gi/gigeometrysimplifier.h"
#include "gi/gibasevectorizer.h"
#include "gicontextfordbdatabase.h"
class dumpvectorizer : public odgigeometrysimplifier, public odgibasevectorizer
{
public:
void polylineout(odint32 n, const odgepoint3d* pts)
{
// here lines should be processed
}
};
vectorization then will look like:
code:

odstaticrxobject<dumpvectorizer> dv;
odstaticrxobject<odgicontextfordbdatabase> gicontext;
gicontext.setdatabase(ptext->database());
dv.setdrawcontext(&dv);
dv.setcontext(&gicontext);
dv.textproc(position, normal, direction, pstrmsg, ilen, true, &gistyle);
where textproc parameters are the same as you posted.
or better:
code:
odstaticrxobject<dumpvectorizer> dv;
odstaticrxobject<odgicontextfordbdatabase> gicontext;
gicontext.setdatabase(ptext->database());
dv.setdrawcontext(&dv);
dv.setcontext(&gicontext);
dv.output().setdestgeometry(dv);
dv.draw(ptext);
to avoid manual normal,etc calculation
vladimir
last edited by vkalinin; 7th september 2005 at 05:33 amfff">.
thank you very much vladimir!!
ft
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】shx Font Representation yang686526 DirectDWG 0 2009-05-07 03:55 PM
【转帖】query regarding oddbtext alignment and position yang686526 DirectDWG 0 2009-05-07 12:05 PM
【转帖】new textstyles in odvectorizee yang686526 DirectDWG 0 2009-05-06 06:28 PM
【转帖】error pdb-settextstyle90 with shx fon yang686526 DirectDWG 0 2009-05-05 09:45 AM
友元((friend) 详解 yogy vc编程 0 2007-05-16 02:20 PM


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


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