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

A procedural which does a deferred load of geometry from disk. More...

#include <RAY_DemoFile.h>

+ Inheritance diagram for HDK_Sample::RAY_DemoFile:

Public Member Functions

 RAY_DemoFile ()
 
 ~RAY_DemoFile () override
 
const char * className () const override
 
int initialize (const UT_BoundingBox *) override
 
void getBoundingBox (UT_BoundingBox &box) override
 The bounding box is the "object space" bounds of the procedural. More...
 
void render () override
 
- 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 fpreal64getFParm (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 fpreal64getFParm (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
 
UT_Matrix4D queryTransform (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

A procedural which does a deferred load of geometry from disk.

Examples:
RAY/RAY_DemoFile.C.

Definition at line 39 of file RAY_DemoFile.h.

Constructor & Destructor Documentation

RAY_DemoFile::RAY_DemoFile ( )
Examples:
RAY/RAY_DemoFile.C, and RAY/RAY_DemoFile.h.

Definition at line 61 of file RAY_DemoFile.C.

RAY_DemoFile::~RAY_DemoFile ( )
override
Examples:
RAY/RAY_DemoFile.h.

Definition at line 69 of file RAY_DemoFile.C.

Member Function Documentation

const char * RAY_DemoFile::className ( ) const
overridevirtual

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_DemoFile.C, and RAY/RAY_DemoFile.h.

Definition at line 74 of file RAY_DemoFile.C.

void RAY_DemoFile::getBoundingBox ( UT_BoundingBox box)
overridevirtual

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

Implements RAY_Procedural.

Examples:
RAY/RAY_DemoFile.C, and RAY/RAY_DemoFile.h.

Definition at line 126 of file RAY_DemoFile.C.

int RAY_DemoFile::initialize ( const UT_BoundingBox box)
overridevirtual

The initialize method is called when the procedural is created. Returning zero (failure) will abort the rendering of this procedural.

The bounding box passed in is the user defined bounding box. If the user didn't specify a bounding box, then the box will be NULL.

Implements RAY_Procedural.

Examples:
RAY/RAY_DemoFile.C, and RAY/RAY_DemoFile.h.

Definition at line 80 of file RAY_DemoFile.C.

void RAY_DemoFile::render ( )
overridevirtual

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_DemoFile.C, and RAY/RAY_DemoFile.h.

Definition at line 132 of file RAY_DemoFile.C.


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