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

mline vectorization
mline vectorization
hi all,
i am trying to display the mlines in a drawing(budwesier.dwg) that have line types of letters mixed with dashes, and the other mline has a thickness with variables colours.
the code i do is the following and all i end up with is a two single white lines. (which is correct in what it is showing in a geometry sense, but i am trying to get the more complex represenatation of the mlines's)
is there anything that i would be doing particaluarly wrong.
odstaticrxobject<repvectorizer> dv;
odstaticrxobject<odgicontextfordbdatabase> gicontext;
gicontext.setdatabase(odmlineptr->database());
dv.setdrawcontext(&dv);
dv.setcontext(&gicontext);
dv.output().setdestgeometry(dv);
dv.draw(odmlineptr);
to sum up the vectorizing is not taking into consideration the style/line type of the mline.
have i made complete sense in my explanation of the above, i hope so, if not, please let me know, and i can attach a simple program and the drawing if necessary.
cheers
jason
hi,
there might be many reasons...
quote:
originally posted by janderssen
i can attach a simple program and the drawing if necessary.
it will definitely save our time. so please do it.
drawing attached,
the mlines that are causing the issue are the ones in box pair number 5.
to some up my code, it basically iteratates through the oddbdatabase and calls the above code as shown.
oh, and thanks in advance for your assistance.
cheers
jason
attached files (228.4 kb, 3 views)

hi,
i need your code.
1. what is parent of repvectorizer ? (must be odgsbasevectorizeview) ?
2. what value returns odgsbasevectorizeview::linetypegenerationcriteria( ) ?
3. etc...
is linetype applied for other entities..?
dmitry,
thanks for your help, the following is the code that i use to vectorize the entity.
total number of points that gets sent to the polyline routine is 2.
line thickness's are correctly vectorized, but other line types are not done correctly now that you bring this up. so i must be doing something wrong.
double d = linetypegenerationcriteria();
d was equal to 0.00000 for both mlines.
polygonout is never called.
is there anything else that you need me to tell you.
for the record :
crepgmtryptr is nothing more than a geometry representation of what the polyline outputs, and this is a node in my scenegraph.
copendwgptr is nothing more than the class that loads the drawings with your library, and returns a scenegraph in my format.
cheers
jason
// header
class repvectorizer : public odgigeometrysimplifier, public odgibasevectorizer {
public:
virtual void polylineout(odint32 n, const odgepoint3d* pts);
virtual void polygonout(odint32 nbpoints, const odgepoint3d *pvertexlist, const odgevector3d *pnormal = 0);
void setrepgmtryent(crepgmtryptr aprepgmtry) { m_aprepgmtry = aprepgmtry;};
void setldr(copendwgptr apldr) { m_apldr = apldr;};
private:
crepgmtryptr m_aprepgmtry;
copendwgptr m_apldr;
};
// cpp
void repvectorizerlylineout(odint32 n, const odgepoint3d* pts) {
e3d::cdbug::log(e3d::cdbug::elvl::dldbg, e3d::cdbug::etype::ltlayout, e3d::cdbug::eopscrte,
dbgdef_ft_function, l"repvectorizer", l"**polylineout** opendwg vectorizer, number points <%d>", n);
if( m_apldr.valid() && m_aprepgmtry.valid() ) {
m_apldr->bgnaddpnts(m_aprepgmtry);
const odgepoint3d *curpnt = pts;
for( int i = 0; i < n; i++ ) {
m_apldr->addpnt2ent(m_aprepgmtry, odgepoint3d(curpnt->x, curpnt->y, curpnt->z));
curpnt++;
}
m_apldr->endaddpnts(m_aprepgmtry);
}
}
//---------------------------------------------------------------------------------
void repvectorizerlygonout(odint32 nbpoints, const odgepoint3d *pvertexlist, const odgevector3d *pnormal) {
e3d::cdbug::log(e3d::cdbug::elvl::dldbg, e3d::cdbug::etype::ltlayout, e3d::cdbug::eopscrte,
dbgdef_ft_function, l"repvectorizer", l"**polygonout** opendwg vectorizer, number points <%d>", nbpoints);
if( m_apldr.valid() && m_aprepgmtry.valid() ) {
m_apldr->bgnaddpnts(m_aprepgmtry);
const odgepoint3d *curpnt = pvertexlist;
for( int i = 0; i < nbpoints; i++ ) {
m_apldr->addpnt2ent(m_aprepgmtry, odgepoint3d(curpnt->x, curpnt->y, curpnt->z));
curpnt++;
}
m_apldr->endaddpnts(m_aprepgmtry);
}
}
last edited by janderssen; 5th july 2006 at 04:48 pmfff">.
hi jason,
geometry conveyor of odgibasevectorizer does not include linetype applier node. you should use odgsbasevectorizeviewfff"> as base class for your repvectorizer.
quote:
originally posted by dmitry a. novikov
hi jason,
geometry conveyor of odgibasevectorizer does not include linetype applier node. you should use odgsbasevectorizeviewfff"> as base class for your repvectorizer.
now i changed to the new class as the base, i now get an access violation at the following location :
opendwgldr.edl!odgilinetyperimpl::setlinetype() + 0x3d c++
opendwgldr.edl!odgsbasevectorizeview::affect2dtrai ts() + 0x139 c++
opendwgldr.edl!odgsbasevectorizeview::affecttraits () + 0x44 c++
opendwgldr.edl!odgibasevectorizer::effectivetraits () + 0x5f c++
opendwgldr.edl!odgibasevectorizer::needdraw() + 0x27 c++
opendwgldr.edl!odgibasevectorizer::draw() + 0x1ab c++
> opendwgldr.edl!e3d::copendwg::getmline(odsmartptr< oddbentity> odentptr={...}, oddbhandle & odhent={...}, e3d::ref_ptr<e3d::clyrmgr> & aplyrmgr={...}) line 2474 c++
so is there anything else i should be doing ?
cheers
jason
last edited by janderssen; 6th july 2006 at 08:44 pmfff">.
hi jason,
it's probably because of direct odgibasevectorizer::draw() method call (instead of odgsview::add(), odgsdevice::update()).
try to insert highlighted lines:
odstaticrxobject<repvectorizer> dv;
odstaticrxobject<odgicontextfordbdatabase> gicontext;
gicontext.setdatabase(odmlineptr->database());
dv.setdrawcontext(&dv);
dv.setcontext(&gicontext);
dv.output().setdestgeometry(dv);
dv.beginviewvectorization();
dv.draw(odmlineptr);
dv.endviewvectorization();
that seems to be the way to do it, thanx again for all your help.
cheers
jason
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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

相似的主题
主题 主题发起者 论坛 回复 最后发表
【转帖】is there a way to cancel vectorization yang686526 DirectDWG 0 2009-05-06 04:19 PM
【转帖】incorrect vectorization of 2d solid yang686526 DirectDWG 0 2009-05-06 03:50 PM
【转帖】different vectorization of same file on windows and mac yang686526 DirectDWG 0 2009-05-04 07:29 PM
【转帖】color problem with hatch while vectorization yang686526 DirectDWG 0 2009-05-04 05:55 PM
【转帖】3d to 2d vectorization yang686526 DirectDWG 0 2009-05-04 03:03 PM


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


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