几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】use Brep.set9const Void Pacisfile0 (http://www.dimcax.com/hust/showthread.php?t=18930)

yang686526 2009-05-07 05:58 PM

【转帖】use Brep.set9const Void Pacisfile0
 
use brep.set(const void* pacisfile)
use brep.set(const void* pacisfile)
now i am using visual studio2005(c++).
void createentity( oddb3dsolid* pent)
{
odbrbrep brep;
odbrbrepfacetraverser bft;
odstreambufptr pstreambuf = odmemorystream::createnew();
odresult result = pent->acisout( pstreambuf, kaf_binary_any );
pstreambuf->rewind();
if ( !( pstreambuf->length() ) )
return;
odbinarydata data;
data.resize( safe_cast<unsigned int>( pstreambuf->length() ) );
pstreambuf->seek( 0, oddb::kseekfromstart );
pstreambuf->getbytes( data.asarrayptr(), safe_cast<odint32>( pstreambuf->length() ) );
brep.set( (const char*)data.asarrayptr() );
if( brep.isvalid() )
bft.setbrep( brep );
}
has error at red line,
because possible to destroy other memory spaces, so cannot read.
how should i do?
set() expects not char* pointing to sat data but pointer to acis file object.
btw, having pointer to 3dsolid you can get brep directly from it:
code:
odbrbrep br;
p3dsolid->brep(br);
see odbrex sample from examples folder.
sergey slezkin
thank you very much.


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