Jump to content
Sign in to follow this  
Guest mantragora

Leftover in constructor or ...

Recommended Posts

Guest mantragora

... is there some deeper story behind this?

 

GUI_PolySoupBox(const GR_RenderInfo *info, const char *cache_name, const GEO_Primitive *prim);
and then

GUI_PolySoupBox::GUI_PolySoupBox(const GR_RenderInfo *info, const char *cache_name, const GEO_Primitive *prim)
: GR_Primitive(info, cache_name, GA_PrimCompat::TypeMask(0))
?

Still not ticking? Lets continue :)

GR_Primitive constructor takes

(const GR_RenderInfo* info, const char* cachename, GEO_PrimTypeCompat::TypeMask primitivetype)
GUI_PolySoupBox last argument is

const GEO_Primitive *prim
and we are setting GR_Primitive last argument as

GA_PrimCompat::TypeMask(0)
I don't see const GEO_Primitive *prim being used anywhere, but I could miss something, so what's the point?

Maybe the point of this is to make something like

return new GUI_PolySoupBox(info, cache_name, GA_PrimCompat::TypeMask(prim->getTypeId().get()));
instead of

return new GUI_PolySoupBox(info, cache_name, prim);
?

Every GUI example in HDK docs have this.

Thanks!

BTW:

What is this GA_PrimCompat::TypeMask? Is there some enum anywhere with values for this that I can use?

BTW2:

Looking at GUI_PolySoupBoxHook::createPrimitive(), there is a check for type of the GEO primitive, then we create new GUI_PolySoupBox() so it would be logical to set GA_PrimCompat::TypeMask instead of passing const GEO_Primitive.

Edited by mantragora

Share this post


Link to post
Share on other sites
Guest mantragora

In other words:

Do I have to pass const GEO_Primitive *prim in constructor of my custom GR_Primitive?

GR_Primitive itself doesn't require it so why I would like to do that in my custom GR_Primitive?

To accomplish what?

Share this post


Link to post
Share on other sites

What I found:

 

GA_PrimCompat::TypeMask(0) is to primitives

 

as

 

GA_PointGroup is to points

 

 

 

TypeMask(0) filters primitives which match the type mask specified.

 

When you selected (0), Houdini takes all the primitives. It is not necessary, that's way you can omit the argument, it works in the same way when you don't define point groups (check that zero) in gdp->getPointBBox(&bbox, 0); and Houdini takes all the points. "GA_PrimCompat::TypeMask(0)" can also be used as mask to iterate the defined groups of primitives in iterators, check this http://www.sidefx.com/docs/hdk13.0/_g_a___g_b_macros_8h.html#accfa36a011faa15dad3800e6ce2320eb

Share this post


Link to post
Share on other sites
Guest mantragora

What I found:

 

GA_PrimCompat::TypeMask(0) is to primitives

 

as

 

GA_PointGroup is to points

 

 

 

TypeMask(0) filters primitives which match the type mask specified.

 

When you selected (0), Houdini takes all the primitives. It is not necessary, that's way you can omit the argument, it works in the same way when you don't define point groups (check that zero) in gdp->getPointBBox(&bbox, 0); and Houdini takes all the points. "GA_PrimCompat::TypeMask(0)" can also be used as mask to iterate the defined groups of primitives in iterators, check this http://www.sidefx.com/docs/hdk13.0/_g_a___g_b_macros_8h.html#accfa36a011faa15dad3800e6ce2320eb

 

That's why I asked, maybe there should be

GA_PrimCompat::TypeMask(prim->getTypeId().get())
and that's why we would like to pass const GEO_Primitive *prim in  in custom GR_Primitive.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×