Jump to content

Leftover in constructor or ...


Guest mantragora

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
Link to comment
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?

Link to comment
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

Link to comment
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.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...