几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】determining model space object from vectorizer module (http://www.dimcax.com/hust/showthread.php?t=15678)

yang686526 2009-05-04 07:23 PM

【转帖】determining model space object from vectorizer module
 
determining model space object from vectorizer module
determining model space object from vectorizer module
hi,
is there any way to determine which model space object that is currently being vectorized from the gs-module (e.g from the function odgsopenglvectorizeview::ontraitsmodified())?
(i have been using layers to render specific objects different from others, but this is a bit restrictive. the best thing would be access to the xdata for the object being rendered.)
hi,
yes there is such a way:
code:
const odgidrawable* odgiconveyorcontext::currentdrawable() const;
const odgidrawabledesc* odgiconveyorcontext::currentdrawabledesc() const;
these methods are implemented in odgibasevectorizer.
note that they may return null.
hi,
thanks for the quick answer! i had a quick look at gidrawable.h and it seems to cover my needs. i'm guessing something like this will do the trick:
code:
const odgidrawable* gid = currentdrawable();
if( gid )
{
if( (gid->drawabletype() == odgidrawable::kgeometry) && gid->ispersistent() )
{
oddbentityptr pent = ((oddbobjectid)gid->id()).safeopenobject(oddb::kforread);
}
}
last edited by tag; 24th august 2007 at 05:11 amfff">. reason: code fixed


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