几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】problem with oddb2dpolylinetransformby 9odgematrix3d0 (http://www.dimcax.com/hust/showthread.php?t=18142)

yang686526 2009-05-06 11:25 PM

【转帖】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


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