![]() |
![]() |
![]() |
![]() |
VolumetricHandlerHandler Activation Function XCALL_( int ) MyVolumetric( long version, GlobalFunc *global, LWVolumetricHandler *local, void *serverData ); The local argument to a volume renderer's activation function is an LWVolumetricHandler. typedef struct st_LWVolumetricHandler { LWInstanceFuncs *inst; LWItemFuncs *item; LWRenderFuncs *rend; double (*evaluate) (LWInstance, LWVolumeAccess *); unsigned int (*flags) (LWInstance); } LWVolumetricHandler; The first three members of this structure point to the standard handler functions. In addition to these, a volume renderer provides an evaluation function and a flags function.
Interface Activation Function XCALL_( int ) MyInterface( long version, GlobalFunc *global, ??? *???, void *serverData ); TBD. Volumetric Access This is the structure passed to the handler's evaluation function. typedef struct st_LWVolumeAccess { void *ray; int flags; LWItemID source; double o[3], dir[3]; double farClip, nearClip; double oDist, frustum; void (*addSample) (void *ray, LWVolumeSample *smp); double (*getOpacity) (void *ray, double dist, double opa[3]); LWIlluminateFunc *illuminate; LWRayTraceFunc *rayTrace; } LWVolumeAccess; Volumetric ray access structure is passed to the volume rendering server to add its contribution to a ray passing through space. The ray is given by a void pointer.
/* * A volume sample is a single segment along a ray through a * volmetric function that has a uniform color and opacity. The * dist and stride are the position and size of the sample and * the opacity and color are given as color vectors. */ typedef struct st_LWVolumeSample { double dist; double stride; double opacity[3]; double color[3]; } LWVolumeSample; |