高级会员
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
|
【转帖】ext Into Polyline For Shx Fonts
text into polyline for shx fonts
text into polyline for shx fonts
hi,
i am trying to read polyline information from oddbtext entity for shx fonts, but get an access violation in the odgigeometrysimplifier.textproc
here is what i am doing
odgitextstyle gistyle;
gifromdbtextstyle(text->textstyle(), gistyle);
gistyle.settextsize(text->height());
gistyle.setxscale(text->widthfactor());
gistyle.setobliquingangle(text->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();
odgigeometrysimplifier geom;
geom.textproc(position, normal, direction, pstrmsg, ilen, true, gistyle);
am i doing somethign wrong here?
thanks in advance
krishna
you must set draw context to simplifier using function odgigeometrysimplifier::setdrawcontext()
sincerely yours,
george udov
quote:
originally posted by george udov
you must set draw context to simplifier using function odgigeometrysimplifier::setdrawcontext()
thank you george for the response, i have been able to call the function successfully but cant seem to figure how to get the text out as polyline. could you help with some sample code or direct me to some code in the existing samples? what we are trying to do is extract the text as polyline and feed it to our viewing system as polylines.
regards
krishna
then you should define inheritant of odgigeometrysimplifier (just like in odvectorizeex sample). in this inheritant you should override polylineproc() (or polylineout() )function. this function will be "callback" for polylines
sample code (only for understanding the technique)
code:
class mygeometrysimplifier : public odgigeometrysimplifier
{
public:
polylineproc(odint32 nbpoints,
const odgepoint3d* pvertexlist,
const odgevector3d* ,
const odgevector3d* pextrusion,
odint32 )
{
// here you'll receive polylines
}
}
mygeometrysimplifier geom;
geom.textproc(position, normal, direction, pstrmsg, ilen, true, gistyle);
sincerely yours,
george udov
|