BRL-CAD
application Struct Reference

#include <raytrace.h>

Collaboration diagram for application:
[legend]

Data Fields

uint32_t a_magic
 
struct xray a_ray
 Actual ray to be shot. More...
 
int(* a_hit )(struct application *, struct partition *, struct seg *)
 called when shot hits model More...
 
int(* a_miss )(struct application *)
 called when shot misses More...
 
int a_onehit
 flag to stop on first hit More...
 
fastf_t a_ray_length
 distance from ray start to end intersections More...
 
struct rt_ia_rt_i
 this librt instance More...
 
int a_zero1
 must be zero (sanity check) More...
 
struct resourcea_resource
 dynamic memory resources More...
 
int(* a_overlap )(struct application *, struct partition *, struct region *, struct region *, struct partition *)
 DEPRECATED. More...
 
void(* a_multioverlap )(struct application *, struct partition *, struct bu_ptbl *, struct partition *)
 called to resolve overlaps More...
 
void(* a_logoverlap )(struct application *, const struct partition *, const struct bu_ptbl *, const struct partition *)
 called to log overlaps More...
 
int a_level
 recursion level (for printing) More...
 
int a_x
 Screen X of ray, if applicable. More...
 
int a_y
 Screen Y of ray, if applicable. More...
 
const char * a_purpose
 Debug string: purpose of ray. More...
 
fastf_t a_rbeam
 initial beam radius (mm) More...
 
fastf_t a_diverge
 slope of beam divergence/mm More...
 
int a_return
 Return of a_hit()/a_miss() More...
 
int a_no_booleans
 1= partitions==segs, no booleans More...
 
char ** attrs
 null terminated list of attributes This list should be the same as passed to rt_gettrees_and_attrs() More...
 
int a_bot_reverse_normal_disabled
 1= no bot normals get reversed in BOT_UNORIENTED_NORM More...
 
struct pixel_exta_pixelext
 locations of pixel corners More...
 
struct sega_finished_segs_hdp
 
struct partitiona_Final_Part_hdp
 
vect_t a_inv_dir
 filled in by rt_shootray(), inverse of ray direction cosines More...
 
int a_user
 application-specific value More...
 
void * a_uptr
 application-specific pointer More...
 
struct bn_tabdataa_spectrum
 application-specific bn_tabdata pointer More...
 
fastf_t a_color [3]
 application-specific color More...
 
fastf_t a_dist
 application-specific distance More...
 
vect_t a_uvec
 application-specific vector More...
 
vect_t a_vvec
 application-specific vector More...
 
fastf_t a_refrac_index
 current index of refraction More...
 
fastf_t a_cumlen
 cumulative length of ray More...
 
int a_flag
 application-specific flag More...
 
int a_zero2
 must be zero (sanity check) More...
 

Detailed Description

This structure is the only parameter to rt_shootray(). The entire structure should be zeroed (e.g. by memset) before it is used the first time.

When calling rt_shootray(), these fields are mandatory:

 - a_ray.r_pt       Starting point of ray to be fired
 - a_ray.r_dir      UNIT VECTOR with direction to fire in (dir cosines)
 - a_hit() Routine to call when something is hit
 - a_miss() Routine to call when ray misses everything
 - a_rt_i           Must be set to the value returned by rt_dirbuild().

In addition, these fields are used by the library. If they are set to zero, default behavior will be used.

 - a_resource       Pointer to CPU-specific resources.  Multi-CPU only.
 - a_overlap() DEPRECATED, set a_multioverlap() instead.
            If non-null, this routine will be called to
            handle overlap conditions.  See librt/bool.c
            for calling sequence.
            Return of 0 eliminates partition with overlap entirely
            Return of !0 retains one partition in output
 - a_multioverlap() Called when two or more regions overlap in a partition.
            Default behavior used if pointer not set.
            See librt/bool.c for calling sequence.
 - a_level          Printed by librt on errors, but otherwise not used.
 - a_x              Printed by librt on errors, but otherwise not used.
 - a_y              Printed by librt on errors, but otherwise not used.
 - a_purpose        Printed by librt on errors, but otherwise not used.
 - a_rbeam          Used to compute beam coverage on geometry,
 - a_diverge        for spline subdivision & many UV mappings.

Note that rt_shootray() returns the (int) return of the a_hit()/a_miss() function called, as well as placing it in a_return. A future "multiple rays at a time" interface will only provide a_return.

Note that the organization of this structure, and the details of the non-mandatory elements are subject to change in every release. Therefore, rather than using compile-time structure initialization, you should create a zeroed-out structure, and then assign the intended values at runtime. A zeroed structure can be obtained at compile time with "static struct application zero_ap;", or at run time by using memset(), bu_calloc(), or BU_ALLOC().

Definition at line 1580 of file raytrace.h.

Field Documentation

uint32_t a_magic
fastf_t a_ray_length

distance from ray start to end intersections

Definition at line 1587 of file raytrace.h.

Referenced by rt_shootray(), and rt_shootray_bundle().

int a_zero1

must be zero (sanity check)

Definition at line 1589 of file raytrace.h.

int(* a_overlap) (struct application *, struct partition *, struct region *, struct region *, struct partition *)

DEPRECATED.

Definition at line 1592 of file raytrace.h.

Referenced by plane_worker(), and rt_default_multioverlap().

void(* a_multioverlap) (struct application *, struct partition *, struct bu_ptbl *, struct partition *)

called to resolve overlaps

Definition at line 1593 of file raytrace.h.

Referenced by rt_boolfinal().

void(* a_logoverlap) (struct application *, const struct partition *, const struct bu_ptbl *, const struct partition *)
fastf_t a_rbeam

initial beam radius (mm)

Definition at line 1599 of file raytrace.h.

Referenced by grass_render(), rr_render(), rt_arb_uv(), rt_ars_uv(), rt_dsp_uv(), rt_ell_uv(), rt_hlf_uv(), rt_metaball_uv(), rt_part_uv(), and rt_sph_uv().

fastf_t a_diverge

slope of beam divergence/mm

Definition at line 1600 of file raytrace.h.

Referenced by grass_render(), points_render(), rr_render(), rt_arb_uv(), rt_ars_uv(), rt_dsp_uv(), rt_ell_uv(), rt_hlf_uv(), rt_metaball_uv(), rt_part_uv(), and rt_sph_uv().

int a_return

Return of a_hit()/a_miss()

Definition at line 1601 of file raytrace.h.

Referenced by light_hit(), rt_shootray(), and rt_shootray_bundle().

int a_no_booleans

1= partitions==segs, no booleans

Definition at line 1602 of file raytrace.h.

Referenced by rt_boolfinal(), and rt_boolweave().

char** attrs

null terminated list of attributes This list should be the same as passed to rt_gettrees_and_attrs()

Definition at line 1603 of file raytrace.h.

int a_bot_reverse_normal_disabled

1= no bot normals get reversed in BOT_UNORIENTED_NORM

Definition at line 1606 of file raytrace.h.

struct pixel_ext* a_pixelext

locations of pixel corners

Definition at line 1610 of file raytrace.h.

Referenced by prj_render().

struct seg* a_finished_segs_hdp

Definition at line 1612 of file raytrace.h.

Referenced by rt_shootray(), and rt_shootray_bundle().

struct partition* a_Final_Part_hdp

Definition at line 1613 of file raytrace.h.

Referenced by rt_shootray(), and rt_shootray_bundle().

vect_t a_inv_dir

filled in by rt_shootray(), inverse of ray direction cosines

Definition at line 1614 of file raytrace.h.

Referenced by rt_pipe_shot(), rt_shootray(), and toon_render().

int a_user

application-specific value

Definition at line 1617 of file raytrace.h.

Referenced by bot_smooth_hit(), hit(), light_hit(), plane_worker(), rr_render(), and rt_bot_smooth().

struct bn_tabdata* a_spectrum

application-specific bn_tabdata pointer

Definition at line 1619 of file raytrace.h.

Referenced by light_hit(), and rr_render().

fastf_t a_color[3]

application-specific color

Definition at line 1620 of file raytrace.h.

Referenced by light_hit(), light_miss(), osl_refraction_hit(), osl_render(), and rr_render().

fastf_t a_dist

application-specific distance

Definition at line 1621 of file raytrace.h.

vect_t a_uvec

application-specific vector

Definition at line 1622 of file raytrace.h.

Referenced by light_hit(), rr_hit(), and rr_render().

vect_t a_vvec

application-specific vector

Definition at line 1623 of file raytrace.h.

Referenced by light_hit(), rr_hit(), and rr_render().

fastf_t a_refrac_index

current index of refraction

Definition at line 1624 of file raytrace.h.

Referenced by light_hit(), osl_render(), rr_hit(), and rr_render().

fastf_t a_cumlen

cumulative length of ray

Definition at line 1625 of file raytrace.h.

Referenced by light_hit(), rr_hit(), rr_render(), and viewshade().

int a_flag

application-specific flag

Definition at line 1626 of file raytrace.h.

Referenced by osl_render(), and rr_render().

int a_zero2

must be zero (sanity check)

Definition at line 1627 of file raytrace.h.


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