HDK
|
Class representing a child object of the current procedural. More...
#include <RAY_Procedural.h>
Public Types | |
enum | AutoProceduralType { AUTOPROCEDURAL_ANY, AUTOPROCEDURAL_AGENT, AUTOPROCEDURAL_PACK, AUTOPROCEDURAL_HEIGHTFIELD, AUTOPROCEDURAL_NONE } |
Public Member Functions | |
RAY_ProceduralChild (RAY_Procedural *parent) | |
~RAY_ProceduralChild () | |
bool | isValid () const |
SYS_SAFE_BOOL | operator bool () const |
Bool operator on handle. More... | |
const RAY_Procedural * | parent () const |
Return parent procedural. More... | |
void | addGeometry (const RAY_ROProceduralGeo &geo) |
void | limitAutoProcedural (AutoProceduralType aproc) |
bool | addProcedural (int argc, char *argv[], const UT_BoundingBox *box=0) |
void | addProcedural (RAY_Procedural *proc) |
void | addVolume (VGEO_Volume *volume, fpreal shutter) |
void | setPreTransform (const UT_Matrix4D &transform, fpreal shutter) |
void | setStylerInfo (const RAY_StylerInfo &styler_info) |
void | setTransform (const UT_Matrix4D &transform, fpreal shutter) |
void | debugSettings (const char *style="object") const |
Print out the object's settings to stderr. More... | |
void | declarePrimitiveAttributeSettings (const GEO_Primitive &prim, const char *prefix) |
bool | setShopMaterialPath (const UT_StringHolder &shop_materialpath, const UT_StringHolder &material_override=UT_StringHolder(), const UT_StringHolder &property_map=UT_StringHolder()) |
void | declarePackedPrimRenderStateSetting (const GEO_Primitive &) |
void | setPackedQuery (RAY_PackedQuery *q) |
bool | changeSetting (const char *name, const char *value, const char *style="object") |
bool | changeSetting (const char *name, int argc, const char *const *argv, const char *style="object") |
bool | changeSetting (const char *name, int argc, const UT_StringHolder *argv, const char *style="object") |
bool | changeSetting (const char *name, int argc, const int *argv, const char *style="object") |
bool | changeSetting (const char *name, int argc, const fpreal *argv, const char *style="object") |
bool | declareSetting (const char *name, const char *value) |
bool | declareSetting (const char *name, int argc, const char *const *argv) |
bool | declareSetting (const char *name, int argc, const int *argv) |
bool | declareSetting (const char *name, int argc, const fpreal *argv) |
void | processPrimitiveMaterial (const GEO_Primitive *prim) |
void | processPrimitiveMaterial (const GEO_Primitive *prim, const RAY_PrimitiveMaterialAttributes &attribs) |
This version takes a set of cached attributes for faster processing. More... | |
Public Member Functions inherited from UT_IntrusiveRefCounter< RAY_ProceduralChild > | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter () noexcept |
Default constructor: Sets counter to 0. More... | |
SYS_FORCE_INLINE | UT_IntrusiveRefCounter (const UT_IntrusiveRefCounter &) noexcept |
Copy constructor: Sets counter to 0. More... | |
UT_IntrusiveRefCounter & | operator= (const UT_IntrusiveRefCounter &) noexcept |
Assignment operator: Does not modify counter. More... | |
SYS_FORCE_INLINE uint32 | use_count () const noexcept |
Return current counter. More... | |
SYS_FORCE_INLINE bool | conditionalAddRef () noexcept |
Additional Inherited Members | |
Protected Member Functions inherited from UT_IntrusiveRefCounter< RAY_ProceduralChild > | |
SYS_FORCE_INLINE | ~UT_IntrusiveRefCounter () |
Destructor: Only derived classes can destruct this. More... | |
Class representing a child object of the current procedural.
When a RAY_Procedural is rendered, the procedural can create child geometry objects, further procedurals, or even a mix of the two.
When creating geometry to be rendered, the code would look something along the lines of:
When adding further procedural children, the code might look something like:
See the HDK examples RAY_DemoMountain or RAY_DemoBox for concrete examples.
Definition at line 432 of file RAY_Procedural.h.
When rendering geometry with packed prims or heightfields, mantra will normally create special procedurals to handle each type of primitive automatically. However, care must be taken when there are a mix of special primitives and other primitives. For example, if there are agent primitives, they are also considered as packed primitives, so the packed procedural shouldn't double render them. The AutoProcType is used internally to indicate what types of geometry should be allowed to show up when creating procedurals. Note that this list may change in future versions.
Enumerator | |
---|---|
AUTOPROCEDURAL_ANY | |
AUTOPROCEDURAL_AGENT | |
AUTOPROCEDURAL_PACK | |
AUTOPROCEDURAL_HEIGHTFIELD | |
AUTOPROCEDURAL_NONE |
Definition at line 462 of file RAY_Procedural.h.
RAY_ProceduralChild::RAY_ProceduralChild | ( | RAY_Procedural * | parent | ) |
RAY_ProceduralChild::~RAY_ProceduralChild | ( | ) |
void RAY_ProceduralChild::addGeometry | ( | const RAY_ROProceduralGeo & | geo | ) |
Set the geometry for the child procedural. This is the preferred interface for setting a child's geometry.
bool RAY_ProceduralChild::addProcedural | ( | int | argc, |
char * | argv[], | ||
const UT_BoundingBox * | box = 0 |
||
) |
Set a child procedural. There are two ways to add a procedural.
The first process is to call with an argc/argv and an optional bounding box. This invokes the standard mantra process of creating a procedural object. Using this interface will cause the initialize() method to be called on the created procedural. The creation status is returned.
void RAY_ProceduralChild::addProcedural | ( | RAY_Procedural * | proc | ) |
The second process for adding a procedural is to add the procedural directly. Using this process bypasses the standard mantra initialization proces (i.e. the initialize() virtual will not be called). This can be used to add procedural objects which aren't registered with mantra (i.e. private classes).
void RAY_ProceduralChild::addVolume | ( | VGEO_Volume * | volume, |
fpreal | shutter | ||
) |
Add a volume primitive to the currently open volume object. Volume objects are reference counted, so if you need to keep a reference to the volume after calling addVolume(), use the incref()/decref() interface to retain a reference. An easy way to do this is to own a UT_IntrusivePtr<VGEO_Volume> object. If you do not own a reference, it's possible the VGEO_Volume pointer will be invalid after this call.
bool RAY_ProceduralChild::changeSetting | ( | const char * | name, |
const char * | value, | ||
const char * | style = "object" |
||
) |
Change any setting on the object (geometry, procedural, volume)
changeSetting(const char *name, const char *value)
changeSetting(const char *name, int argc, char **argv)
changeSetting(const char *name, int argc, int *argv)
changeSetting(const char *name, int argc, fpreal *argv)
If the setting specified by "name" isn't found, the function will fail (return false). bool RAY_ProceduralChild::changeSetting | ( | const char * | name, |
int | argc, | ||
const char *const * | argv, | ||
const char * | style = "object" |
||
) |
Change any setting on the object (geometry, procedural, volume)
changeSetting(const char *name, const char *value)
changeSetting(const char *name, int argc, char **argv)
changeSetting(const char *name, int argc, int *argv)
changeSetting(const char *name, int argc, fpreal *argv)
If the setting specified by "name" isn't found, the function will fail (return false). bool RAY_ProceduralChild::changeSetting | ( | const char * | name, |
int | argc, | ||
const UT_StringHolder * | argv, | ||
const char * | style = "object" |
||
) |
Change any setting on the object (geometry, procedural, volume)
changeSetting(const char *name, const char *value)
changeSetting(const char *name, int argc, char **argv)
changeSetting(const char *name, int argc, int *argv)
changeSetting(const char *name, int argc, fpreal *argv)
If the setting specified by "name" isn't found, the function will fail (return false). bool RAY_ProceduralChild::changeSetting | ( | const char * | name, |
int | argc, | ||
const int * | argv, | ||
const char * | style = "object" |
||
) |
Change any setting on the object (geometry, procedural, volume)
changeSetting(const char *name, const char *value)
changeSetting(const char *name, int argc, char **argv)
changeSetting(const char *name, int argc, int *argv)
changeSetting(const char *name, int argc, fpreal *argv)
If the setting specified by "name" isn't found, the function will fail (return false). bool RAY_ProceduralChild::changeSetting | ( | const char * | name, |
int | argc, | ||
const fpreal * | argv, | ||
const char * | style = "object" |
||
) |
Change any setting on the object (geometry, procedural, volume)
changeSetting(const char *name, const char *value)
changeSetting(const char *name, int argc, char **argv)
changeSetting(const char *name, int argc, int *argv)
changeSetting(const char *name, int argc, fpreal *argv)
If the setting specified by "name" isn't found, the function will fail (return false). void RAY_ProceduralChild::debugSettings | ( | const char * | style = "object" | ) | const |
Print out the object's settings to stderr.
|
inline |
This function has no implementation in H16.0 and beyond. Please use setPackedQuery()
;
Definition at line 607 of file RAY_Procedural.h.
void RAY_ProceduralChild::declarePrimitiveAttributeSettings | ( | const GEO_Primitive & | prim, |
const char * | prefix | ||
) |
Convenience method that declares settings for all attributes associated with a given primitive, including the corresponding vertices, points, and parent detail. This is primarily used for packed primitives. The name of the setting will be the same as the attribute name prefixed with the given prefix.
bool RAY_ProceduralChild::declareSetting | ( | const char * | name, |
const char * | value | ||
) |
It's possible to add new settings to a child object. These settings can be accessed in shaders using the VEX renderstate() function.
It is illegal to:
This is equivalent to the ray_declare command in IFDs.
bool RAY_ProceduralChild::declareSetting | ( | const char * | name, |
int | argc, | ||
const char *const * | argv | ||
) |
It's possible to add new settings to a child object. These settings can be accessed in shaders using the VEX renderstate() function.
It is illegal to:
This is equivalent to the ray_declare command in IFDs.
It's possible to add new settings to a child object. These settings can be accessed in shaders using the VEX renderstate() function.
It is illegal to:
This is equivalent to the ray_declare command in IFDs.
It's possible to add new settings to a child object. These settings can be accessed in shaders using the VEX renderstate() function.
It is illegal to:
This is equivalent to the ray_declare command in IFDs.
bool RAY_ProceduralChild::isValid | ( | ) | const |
Test whether the child is valid. This checks to see whether there's a valid geometry, child procedural or a volume attached.
void RAY_ProceduralChild::limitAutoProcedural | ( | AutoProceduralType | aproc | ) |
Limit the types of procedurals which can be automatically created to handle special primitive types. For example, if setting to AUTOPROCEDURAL_PACK, no special agent primitives will be created (but heightfields will).
|
inline |
Bool operator on handle.
Definition at line 444 of file RAY_Procedural.h.
|
inline |
Return parent procedural.
Definition at line 447 of file RAY_Procedural.h.
void RAY_ProceduralChild::processPrimitiveMaterial | ( | const GEO_Primitive * | prim | ) |
Convenience method to check for the following attributes on a primitive This method will check for the following attributes:
void RAY_ProceduralChild::processPrimitiveMaterial | ( | const GEO_Primitive * | prim, |
const RAY_PrimitiveMaterialAttributes & | attribs | ||
) |
This version takes a set of cached attributes for faster processing.
void RAY_ProceduralChild::setPackedQuery | ( | RAY_PackedQuery * | q | ) |
Set the packed query lookup for this procedural. This method takes ownership of the query passed in.
void RAY_ProceduralChild::setPreTransform | ( | const UT_Matrix4D & | transform, |
fpreal | shutter | ||
) |
Transform the currently open object (geometry, procedural, volume) at the shutter time specified. The transform is a pre-transform that acts on the parent procedural's existing transform. This interface should be used to achieve the expected parenting behavior for procedurals, in which the transform is an object space transform inside the parent space.
bool RAY_ProceduralChild::setShopMaterialPath | ( | const UT_StringHolder & | shop_materialpath, |
const UT_StringHolder & | material_override = UT_StringHolder() , |
||
const UT_StringHolder & | property_map = UT_StringHolder() |
||
) |
Calling setShopMaterialPath()
will simulate adding the "shop_materialpath" and optionally the "material_override" and attributes on the geometry. This must be called after the openGeometryObject()
and before the corresponding closeObject()
calls. The property_map
string is used to map the Houdini parameter names in the material_override
string to mantra property names. Without this map, properties will not be overridden properly.
void RAY_ProceduralChild::setStylerInfo | ( | const RAY_StylerInfo & | styler_info | ) |
Assign new style sheet node to the currently open object. Procedurals often prune the style sheet of entries that no longer apply to the geometry hierarchy.
void RAY_ProceduralChild::setTransform | ( | const UT_Matrix4D & | transform, |
fpreal | shutter | ||
) |
Transform the currently open object (geometry, procedural, volume) at the shutter time specified. The transform is a post-transform that acts on the parent procedural's existing transform. This method is preferred when you need to change the world transform from within the procedural. In most cases, setPreTransform() is preferred over setTransform().