查看单个帖子
旧 2009-05-06, 11:25 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】problem with oddb2dpolylinetransformby 9odgematrix3d0

problem with oddb2dpolyline::transformby (odgematrix3d&)
problem with oddb2dpolyline::transformby (odgematrix3d&)
transformby doesn´t work with appended vertices.
the same logic with simple lines works.
i´ve looked to the implementation of oddb2dpolyline::transformby (...) .
the function step over the vertices and calls
oddb2dverteximpl::getimpl(pvert)->transformby(trans, scale);
my own code :
oddb2dpolylineptr ppolyline = oddb2dpolyline::createobject();
for ( ... )
{
oddb2dvertexptr pvertex = oddb2dvertex::createobject();
...
ppolyline->appendvertex(pvertex);
}
odgematrix3d xform;
xform.settoscaling ( 0.001 );
odresult result = m_ppolyline ->transformby ( xform );
assert ( result == eok );
...
precord = m_activeblockrecordid.openobject (oddb::kforwrite);
objectid = precord->appendoddbentity ( ppolyline );
...
last edited by uspiess@nemetschek.de; 7th may 2004 at 12:41 amfff">.
this bug is already fixed for upcoming 1.11 release.
possible work around is to add the polyline to database first and call transformby() after that.
the reason is that if an entity container is not database resident subentity iterator skips all subentities (it treats them as erased). passing openerased=true to the iterator can also heal the problem but it required transformby() body editing.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)