HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HDK_Sample::ray_ChildBox Class Reference

Procedural used in RAY/RAY_DemoStamp.C to render a box. More...

+ Inheritance diagram for HDK_Sample::ray_ChildBox:

Public Member Functions

 ray_ChildBox (UT_Vector3 &center, fpreal size)
 
virtual ~ray_ChildBox ()
 
virtual const char * className () const
 
virtual int initialize (const UT_BoundingBox *)
 
virtual void getBoundingBox (UT_BoundingBox &box)
 The bounding box is the "object space" bounds of the procedural. More...
 
virtual void render ()
 
- Public Member Functions inherited from RAY_Procedural
 RAY_Procedural ()
 
virtual ~RAY_Procedural ()
 
virtual bool isEqual (const RAY_Procedural *) const
 
virtual bool canGenerateInstancedGeometry () const
 
int lookupParmToken (const char *name) const
 
RAY_ProceduralGeo createGeometry () const
 Allocate geometry for this procedural. More...
 
const int64getIParm (int token, size_t &size) const
 
const fprealgetFParm (int token, size_t &size) const
 
const UT_StringHoldergetSParm (int token, size_t &size) const
 
const int64getIParm (const char *name, size_t &size) const
 
const fprealgetFParm (const char *name, size_t &size) const
 
const UT_StringHoldergetSParm (const char *name, size_t &size) const
 
bool import (const char *name, int32 *value, int vectorsize) const
 
bool import (const char *name, int64 *value, int vectorsize) const
 
bool import (const char *name, fpreal32 *value, int vectorsize) const
 
bool import (const char *name, fpreal64 *value, int vectorsize) const
 
bool import (const char *name, UT_String &result, int idx=0) const
 
bool import (const char *name, UT_StringHolder &result, int idx=0) const
 
bool import (RAY_Handle handle, const char *name, int32 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, int64 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, fpreal32 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, fpreal64 *value, int vectorsize) const
 
bool import (RAY_Handle handle, const char *name, UT_String &result, int idx=0) const
 
bool import (RAY_Handle handle, const char *name, UT_StringHolder &result, int idx=0) const
 
bool importAll (RAY_Handle handle, UT_Options &settings, bool local_only=false) const
 
RAY_ROProceduralGeo createGeometry (GU_DetailHandle &gdh) const
 
RAY_ROProceduralGeo createGeometry (GU_ConstDetailHandle &gdh) const
 
RAY_ROProceduralGeo createGeometry (const GU_DetailHandle *gdh, int nsegments, const fpreal *shutter_times=nullptr) const
 
RAY_ROProceduralGeo createGeometry (const GU_ConstDetailHandle *gdh, int nsegments, const fpreal *shutter_times=nullptr) const
 
RAY_ProceduralData * data ()
 

Additional Inherited Members

- Static Public Member Functions inherited from RAY_Procedural
static void optimizeGeometry (GU_Detail &gdp, bool create_normals_if_needed)
 
static void optimizeGeometry (GU_DetailHandle &gdp, bool create_normals_if_needed)
 
- Protected Member Functions inherited from RAY_Procedural
const GA_AttributequeryGeometrySegment (const GA_Attribute *attr, int seg) const
 
void clearGeometrySegments (GA_Attribute *attr)
 
fpreal getLevelOfDetail (const UT_BoundingBox &box) const
 
RAY_ProceduralChildPtr createChild () const
 
void openGeometryObject ()
 
void addGeometry (GU_Detail *gdp, fpreal shutter)
 
int openProceduralObject ()
 Open a procedural object. More...
 
void addProcedural (RAY_Procedural *proc)
 
int addProcedural (int argc, char *argv[], const UT_BoundingBox *box=0)
 
void openVolumeObject ()
 Open a volume object. More...
 
void addVolume (VGEO_Volume *volume, fpreal shutter)
 
void setPreTransform (const UT_Matrix4D &transform, fpreal shutter)
 
void setTransform (const UT_Matrix4D &transform, fpreal shutter)
 
void setStylerInfo (const RAY_StylerInfo &styler_info)
 
bool setShopMaterialPath (const char *shop_materialpath, const char *material_override=nullptr, const char *property_map=nullptr)
 
void debugSettings (const char *style="object") const
 Print out the object's settings to stderr. More...
 
void processPrimitiveMaterial (const GEO_Primitive *prim)
 
void closeObject ()
 
bool parseMaterialIFD (const char *filename)
 
int queryWorldTransformSamples () const
 Query the number of transform samples for the world. More...
 
UT_Matrix4D queryWorldTransform (int sample) const
 Get the world transform. More...
 
RAY_ObjectHandle queryObject (const char *name) const
 
RAY_MaterialHandle queryMaterial (const char *name) const
 
RAY_LightHandle queryLight (const char *name) const
 
int queryTransformSamples (RAY_Handle handle) const
 
const UT_Matrix4DqueryTransform (RAY_Handle handle, int sample) const
 
const UT_Matrix4DqueryShaderTransform (RAY_ObjectHandle handle, int sample) const
 
const STY_StylerqueryStyler (RAY_ObjectHandle handle) const
 
const char * queryName (RAY_Handle handle) const
 
const char * queryRootName () const
 Get the name of the object which owns this procedural. More...
 
int queryGeometrySamples (RAY_ObjectHandle handle) const
 
RAY_ROProceduralGeo queryGeometry (RAY_ObjectHandle handle) const
 
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 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)
 
- Static Protected Member Functions inherited from RAY_Procedural
static void lookupPrimitiveMaterialAttributes (const GEO_Detail &geo, RAY_PrimitiveMaterialAttributes &attribs)
 

Detailed Description

Procedural used in RAY/RAY_DemoStamp.C to render a box.

See Also
RAY/RAY_DemoBox.C
Examples:
RAY/RAY_DemoStamp.C.

Definition at line 39 of file RAY_DemoStamp.C.

Constructor & Destructor Documentation

HDK_Sample::ray_ChildBox::ray_ChildBox ( UT_Vector3 center,
fpreal  size 
)
inline
Examples:
RAY/RAY_DemoStamp.C.

Definition at line 42 of file RAY_DemoStamp.C.

virtual HDK_Sample::ray_ChildBox::~ray_ChildBox ( )
inlinevirtual
Examples:
RAY/RAY_DemoStamp.C.

Definition at line 46 of file RAY_DemoStamp.C.

Member Function Documentation

virtual const char* HDK_Sample::ray_ChildBox::className ( ) const
inlinevirtual

The class name is used in diagnostic messages. It can simply be the name of the class, or alternatively, you can choose a unique name for each procedural instance.

Implements RAY_Procedural.

Examples:
RAY/RAY_DemoStamp.C.

Definition at line 48 of file RAY_DemoStamp.C.

virtual void HDK_Sample::ray_ChildBox::getBoundingBox ( UT_BoundingBox box)
inlinevirtual

The bounding box is the "object space" bounds of the procedural.

Implements RAY_Procedural.

Examples:
RAY/RAY_DemoStamp.C.

Definition at line 55 of file RAY_DemoStamp.C.

virtual int HDK_Sample::ray_ChildBox::initialize ( const UT_BoundingBox )
inlinevirtual

Since the procedural is generated by stamp, this method will never be called.

Implements RAY_Procedural.

Examples:
RAY/RAY_DemoStamp.C.

Definition at line 51 of file RAY_DemoStamp.C.

virtual void HDK_Sample::ray_ChildBox::render ( )
inlinevirtual

The render method is called when the procedural is required to either generate geometry or split into more procedurals. Inside the render() method you should make calls to open/add/close geometry or sub-procedurals.

The way that a procedural splits is critical to the performance of mantra's ray tracer. For optimal performance, make sure that sub-procedural bounding boxes overlap as little as possible - which allows mantra to build more optimal trees for ray tracing.

In multi-threaded renders, the render() method needs to be reentrant

  • that is, the render() method on different RAY_Procedural objects may be called simultaneously by different threads. This means that you should design the code in your procedural such that global data structures are protected by a thread lock (for example, a UT_Lock).
    Note
    The render method may be called more than once during a render to regenerate the geometry.

Implements RAY_Procedural.

Examples:
RAY/RAY_DemoStamp.C.

Definition at line 60 of file RAY_DemoStamp.C.


The documentation for this class was generated from the following file: