![]() |
【转帖】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. |