查看单个帖子
旧 2009-05-04, 07:23 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】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:ntraitsmodified())?
(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
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)