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

problem with orbit
problem with orbit
1/ i create a new document in odamfcapp
2/ i draw a line parrallel to the y axe
when i do a rotate x the line is not draw correctly (same a z clipping )
if save this file, when i re open it, it work correctly ... strange no?
i have the same pb in my application ....
thierry
can you zip and upload the offending code?
quote:
originally posted by open design alliance
can you zip and upload the offending code?
is in odamfcapp.exe, i think is the creation of a default database with the createdatabase function .... for this part my code is the same ...
thierry
could you explain what do you mean by "is not drawn correctly"?
btw, view changes after zooming/paning/rotating in odamfcapp are not saved to file.
sergey slezkin
thank for your answer,
i upload a pdf file to explain why is not good ....
its only with opengl end opengl cache device, its good with wingdi (but it's impossible to shade), and only when the drawing is a new database ...
thierry
attached files (302.2 kb, 18 views)

to help you ... i hope
i have trace the gsopenglvectorizer.cpp when i open a new drawing (new database) opengl don't go in viewdeptrange .....
and when a object is created (new line new block ...), viewdeptrange is not call and zfar & znear are not updated
with a new database
opengl .......
---------------------------------------------
odgsopenglvectorizeview : update
left 0
bottom 0
width 481
height481
---------------------------------------------
odgsopenglvectorizeview : getglscreenrect
left 0.000000
bottom 0.000000
width 481.000000
height481.000000
---------------------------------------------
odgsopenglvectorizeview : beginviewvectorization
when open a dwg (created before with application)
opengl .......
---------------------------------------------
odgsopenglvectorizeview : update
left 0
bottom 0
width 481
height481
---------------------------------------------
odgsopenglvectorizeview : getglscreenrect
left 0.000000
bottom 0.000000
width 481.000000
height481.000000
---------------------------------------------
odgsopenglvectorizeview : beginviewvectorization
odgsopenglvectorizeview : viewdeptrange
zfar -1.000000
znear 1.000000
--------------------------------------------
last edited by thierry; 28th january 2005 at 04:50 amfff">.
more help
if i add this after create a block
database()->updateext();
extmin and extmax is good :
oddblayoutptr playout = m_layoutid.safeopenobject();
odgepoint3d extmin = playout->getextmin(), extmax = playout->getextmax();
but modelextents in odgsopenglvectorizeview::viewdeptrange return always !extents.isvalidextents() and the zfar and znear value are never update ....
can you help me?
my code :
void ccallbrowserview:ndropfiles(hdrop hdropinfo)
{
oddbdatabase* l_pdb = static_cast<ccallbrowserdoc*>(getdocument());
oddbblocktableptr l_pblocks;
cstring l_blockname;
if(m_pssetdrawable.isnull())
{
m_pssetdrawable = myssetdrawable::createobject();
}
myssetdrawable* pss = static_cast<myssetdrawable*>(m_pssetdrawable.get() );
pss->m_sset.clear();
/////////////////////////////////////////////////
...
...
bool res = dragquerypoint( hdropinfo, &l_point);
m_startpoint = m_endpoint = l_point;
odgepoint3d start, end;
getworldstartendpoints(start, end);
....
.....
while (myfiles ())
{
myfiles.snextfile (l_buf);
cfile l_file(l_buf,cfile::moderead);
/////////////// creation du bloc ///
l_blockname = l_file.getfiletitle();
l_file.close();
if(m_interactionmode == korbite3d) invalidate();
l_blockname = l_blockname.left(l_blockname.getlength()-4);
l_pblocks = l_pdb->getblocktableid().safeopenobject(oddb::kforwrite) ;
m_idblock = l_pblocks->getat((odstring)l_blockname.getbuffer(0));
if (!m_idblock)
{
odstring l_blockfilename = (odstring)l_buf.getbuffer(0);
oddbdatabaseptr l_pdbblock = theapp.readfile(l_blockfilename, false, false);
m_idblock = l_pdb->insert((odstring)l_blockname.getbuffer(0), l_pdbblock, true);
}
oddbobjectid l_brefid;
m_pnewblockreference = oddbblockreference::createobject();
m_pnewblockreference->setdatabasedefaults(database());
m_pnewblockreference->setblocktablerecord(m_idblock);
if (!theapp.getredliningcur())
{
odstring l_layername = theapp.getredliningname();
odcmcolor l_layercolor;
l_layercolor.setrgb(odgetred(theapp.getredliningco lor()), odgetgreen(theapp.getredliningcolor()), odgetblue(theapp.getredliningcolor()));
m_pnewblockreference->setlayer(addlayer(l_layername));
m_pnewblockreference->setcolor(l_layercolor);
}
////////////////////////////////////
addextendeddata(m_pnewblockreference);
....
....
...
oddbblocktablerecordptr pspace = database()->getactivelayoutbtrid().safeopenobject(oddb::kforw rite);
database()->startundorecord();
l_brefid = pspace->appendoddbentity(m_pnewblockreference);
pss->m_sset.append(l_brefid);
m_pnewblockreference.release();
}
odgescale3d l_scale3d(m_xscale,m_yscale,m_zscale);
odgematrix3d l_xformsel(odgematrix3d::translation(start - odgepoint3d(0,0,0) )*
odgematrix3d::rotation(deg2rad * m_angle, odgevector3d::kzaxis) *
odgematrix3d::scaling(l_scale3d));
if(pss)
{
database()->startundorecord();
pss->transformby(l_xformsel);
database()->updateext();
oddblayoutptr playout = m_layoutid.safeopenobject();
odgepoint3d extmin = playout->getextmin(), extmax = playout->getextmax();
#ifdef _logfile
file* l_logfile;
l_logfile = fopen("c:\\opengl.log","a");
fprintf(l_logfile, " extmin x = %f, y=%f z=%f\n", extmin.x, extmin.y, extmin.z);
fprintf(l_logfile, " extmax x = %f, y=%f z=%f\n", extmax.x, extmax.y, extmax.z);
fprintf(l_logfile, " ---------------------------------------------\n");
fclose(l_logfile);
#endif
redrawwindow();
}
last edited by thierry; 28th january 2005 at 07:01 amfff">.
unfortunately it's defect in 1.12 opengl device. it will be fixed in next release.
as a temporary workaround you can add a function to odgsopenglvectorizeview which will set m_bmodelextentsvalid member to false after adding entities to database. it will force extents updating.
sergey slezkin
thank you sergey,
i try that, and wait for the next release
best regards
thierry
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)
 


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

高级搜索
显示模式

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

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



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


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