Ray Tracing
[librt geometry, raytracing]

Collaboration diagram for Ray Tracing:


Files

file  bezier_2d_isect.c
file  bigE.c
file  bool.c
file  cmd.c
file  cut.c
file  prep.c
file  shoot.c
file  vshoot.c

Defines

#define SGN(_x)   (((_x)<0) ? -1 : 1)
#define MAXDEPTH   64
#define V3PT_DEPARTING_RPP(_step, _lo, _hi, _pt)   PT_DEPARTING_RPP(_step, _lo, _hi, (_pt)[X], (_pt)[Y], (_pt)[Z] )
#define PT_DEPARTING_RPP(_step, _lo, _hi, _px, _py, _pz)
#define SEG_MISS(SEG)   (SEG).seg_stp=(struct soltab *) 0;
#define SEG_MISS(SEG)   (SEG).seg_stp=(struct soltab *) 0;

Functions

int CrossingCount (point2d_t *V, int degree, point2d_t ray_start, point2d_t ray_dir, point2d_t ray_perp)
int ControlPolygonFlatEnough (point2d_t *V, int degree, fastf_t epsilon)
void Bezier (point2d_t *V, int degree, double t, point2d_t *Left, point2d_t *Right, point2d_t eval_pt, point2d_t normal)
int FindRoots (point2d_t *w, int degree, point2d_t **intercept, point2d_t **normal, point2d_t ray_start, point2d_t ray_dir, point2d_t ray_perp, int depth, fastf_t epsilon)
bezier_2d_listsubdivide_bezier (struct bezier_2d_list *bezier_in, int degree, fastf_t epsilon, int depth)
void rt_plot_cell (const union cutter *cutp, const struct rt_shootray_status *ssp, struct bu_list *waiting_segs_hd, struct rt_i *rtip)
void rt_res_pieces_init (struct resource *resp, struct rt_i *rtip)
void rt_res_pieces_clean (struct resource *resp, struct rt_i *rtip)
int rt_find_nugrid (const struct nugridnode *nugnp, int axis, fastf_t val)
const union cutterrt_advance_to_next_cell (register struct rt_shootray_status *ssp)
fastf_t rt_find_backing_dist (struct rt_shootray_status *ss, struct bu_bitv *backbits)
int rt_shootray (register struct application *ap)
const union cutterrt_cell_n_on_ray (register struct application *ap, int n)
int rt_in_rpp (struct xray *rp, register const fastf_t *invdir, register const fastf_t *min, register const fastf_t *max)
int rt_DB_rpp (register struct xray *rp, register const fastf_t *invdir, register const fastf_t *min, register const fastf_t *max)
void rt_vstub (struct soltab **stp, struct xray **rp, struct seg *segp, int n, struct application *ap)
void rt_pr_library_version (void)
void rt_zero_res_stats (struct resource *resp)
void rt_add_res_stats (register struct rt_i *rtip, register struct resource *resp)
void rt_3move_raydist (FILE *fp, struct xray *rayp, double dist)
void rt_3cont_raydist (FILE *fp, struct xray *rayp, double dist)
int rt_shootray (struct application *ap)
 rt_vstub (struct soltab *stp[], struct xray *rp[], struct seg segp[], int n, struct resource *resp)
 rt_in_rpp (struct xray *rp, fastf_t *invdir, fastf_t *min, fastf_t *max)
void rt_bitv_or (bitv_t *out, bitv_t *in, int nbits)
void rt_get_bitv (struct rt_i *rtip, struct resource *res)

Variables

resource rt_uniresource
 default. Defined in librt/shoot.c
resource rt_uniresource
 default. Defined in librt/shoot.c

Define Documentation

#define SGN _x   )     (((_x)<0) ? -1 : 1)
 

Definition at line 49 of file bezier_2d_isect.c.

Referenced by CrossingCount().

#define MAXDEPTH   64
 

Definition at line 50 of file bezier_2d_isect.c.

Referenced by FindRoots(), and subdivide_bezier().

#define V3PT_DEPARTING_RPP _step,
_lo,
_hi,
_pt   )     PT_DEPARTING_RPP(_step, _lo, _hi, (_pt)[X], (_pt)[Y], (_pt)[Z] )
 

Definition at line 77 of file shoot.c.

#define PT_DEPARTING_RPP _step,
_lo,
_hi,
_px,
_py,
_pz   ) 
 

Value:

(   ((_step)[X] <= 0 && (_px) < (_lo)[X]) || \
                    ((_step)[X] >= 0 && (_px) > (_hi)[X]) || \
                    ((_step)[Y] <= 0 && (_py) < (_lo)[Y]) || \
                    ((_step)[Y] >= 0 && (_py) > (_hi)[Y]) || \
                    ((_step)[Z] <= 0 && (_pz) < (_lo)[Z]) || \
                    ((_step)[Z] >= 0 && (_pz) > (_hi)[Z])   )

Definition at line 79 of file shoot.c.

#define SEG_MISS SEG   )     (SEG).seg_stp=(struct soltab *) 0;
 

Definition at line 1914 of file shoot.c.

#define SEG_MISS SEG   )     (SEG).seg_stp=(struct soltab *) 0;
 

Definition at line 355 of file vshoot.c.


Function Documentation

int CrossingCount point2d_t V,
int  degree,
point2d_t  ray_start,
point2d_t  ray_dir,
point2d_t  ray_perp
 

Definition at line 58 of file bezier_2d_isect.c.

References SGN, V2DOT, and V2SUB2.

Referenced by FindRoots().

int ControlPolygonFlatEnough point2d_t V,
int  degree,
fastf_t  epsilon
 

Definition at line 90 of file bezier_2d_isect.c.

References bu_malloc(), X, and Y.

Referenced by FindRoots(), and subdivide_bezier().

Here is the call graph for this function:

void Bezier point2d_t V,
int  degree,
double  t,
point2d_t Left,
point2d_t Right,
point2d_t  eval_pt,
point2d_t  normal
 

Definition at line 201 of file bezier_2d_isect.c.

References bu_calloc(), and V2MOVE.

Referenced by FindRoots(), and subdivide_bezier().

Here is the call graph for this function:

int FindRoots point2d_t w,
int  degree,
point2d_t **  intercept,
point2d_t **  normal,
point2d_t  ray_start,
point2d_t  ray_dir,
point2d_t  ray_perp,
int  depth,
fastf_t  epsilon
 

Definition at line 367 of file bezier_2d_isect.c.

References Bezier(), bu_calloc(), bu_free(), bu_malloc(), ControlPolygonFlatEnough(), CrossingCount(), FindRoots(), MAXDEPTH, NULL, and V2MOVE.

Referenced by FindRoots().

Here is the call graph for this function:

struct bezier_2d_list* subdivide_bezier struct bezier_2d_list bezier_in,
int  degree,
fastf_t  epsilon,
int  depth
 

Definition at line 461 of file bezier_2d_isect.c.

References Bezier(), bu_calloc(), bu_free(), BU_LIST_APPEND, BU_LIST_APPEND_LIST, BU_LIST_DEQUEUE, BU_LIST_INIT, bu_malloc(), ControlPolygonFlatEnough(), bezier_2d_list::ctl, bezier_2d_list::l, MAXDEPTH, NULL, and subdivide_bezier().

Referenced by subdivide_bezier().

Here is the call graph for this function:

void rt_plot_cell const union cutter cutp,
const struct rt_shootray_status ssp,
struct bu_list waiting_segs_hd,
struct rt_i rtip
 

Definition at line 2040 of file shoot.c.

References application::a_resource, application::a_rt_i, rt_shootray_status::ap, cutter::bn, cutter::boxnode::bn_len, cutter::boxnode::bn_list, cutter::boxnode::bn_max, cutter::boxnode::bn_min, bu_bomb(), bu_log(), CUT_BOXNODE, cutter::cut_type, fp, NULL, pdv_3box(), pdv_3space(), perror(), pl_color(), RT_AP_CHECK, RT_CK_RTI, rt_plot_solid(), rt_i::rti_pmax, and rt_i::rti_pmin.

Here is the call graph for this function:

void rt_res_pieces_init struct resource resp,
struct rt_i rtip
 

Definition at line 94 of file shoot.c.

References bu_bitv_new(), bu_calloc(), rt_piecestate::cutp, CUTTER_NULL, rt_piecestate::htab, rt_piecestate::magic, resource::re_pieces, RT_CK_RESOURCE, RT_CK_RTI, RT_CK_SOLTAB, rt_htbl_init(), RT_PIECESTATE_MAGIC, RT_VISIT_ALL_SOLTABS_END, RT_VISIT_ALL_SOLTABS_START, rt_i::rti_nsolids_with_pieces, rt_piecestate::shot, soltab::st_npieces, soltab::st_piecestate_num, and rt_piecestate::stp.

Referenced by rt_shootray().

Here is the call graph for this function:

void rt_res_pieces_clean struct resource resp,
struct rt_i rtip
 

Definition at line 123 of file shoot.c.

References bu_bitv_free(), bu_free(), bu_ptbl_free(), rt_piecestate::htab, rt_piecestate::magic, NULL, resource::re_pieces, resource::re_pieces_pending, RT_CK_PIECESTATE, RT_CK_RESOURCE, RT_CK_RTI, rt_htbl_free(), rt_i::rti_nsolids_with_pieces, and rt_piecestate::shot.

Referenced by rt_clean_resource(), and rt_unprep().

Here is the call graph for this function:

int rt_find_nugrid const struct nugridnode *  nugnp,
int  axis,
fastf_t  val
 

Definition at line 158 of file shoot.c.

const union cutter* rt_advance_to_next_cell register struct rt_shootray_status ssp  ) 
 

Definition at line 197 of file shoot.c.

References application::a_ray, application::a_rt_i, bu_log(), CUT_NUGRIDNODE, cutter::cut_type, CUTTER_NULL, cutter::nugridnode::nu_axis, cutter::nugridnode::nu_cells_per_axis, cutter::nugridnode::nu_grid, cutter::nugridnode::nu_stepsize, cutter::nugn, NUGRID_T_SETUP, xray::r_dir, xray::r_pt, rt_find_nugrid(), rt_i::rti_CutHead, top(), X, Y, and Z.

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

Here is the call graph for this function:

fastf_t rt_find_backing_dist struct rt_shootray_status ss,
struct bu_bitv backbits
 

Definition at line 681 of file shoot.c.

References application::a_ray, application::a_resource, application::a_rt_i, rt_shootray_status::ap, BACKING_DIST, cutter::bn, cutter::boxnode::bn_max, cutter::boxnode::bn_min, cutter::boxnode::bn_piecelen, cutter::boxnode::bn_piecelist, BU_BITSET, BU_BITTEST, bu_bitv_clear(), cutter::cn, cutter::cutnode::cn_axis, cutter::cutnode::cn_l, cutter::cutnode::cn_point, cutter::cutnode::cn_r, CUT_CUTNODE, cutter::cut_type, get_solidbitv(), rt_shootray_status::inv_dir, rt_i::nsolids, OFFSET_DIST, xray::r_dir, xray::r_max, xray::r_pt, rt_in_rpp(), rt_i::rti_CutHead, and VJOIN1.

Referenced by rt_shootray().

Here is the call graph for this function:

int rt_shootray register struct application ap  ) 
 

Definition at line 794 of file shoot.c.

References rt_shootray_status::abs_inv_dir, rt_shootray_status::ap, BACKING_DIST, cutter::bn, cutter::boxnode::bn_len, cutter::boxnode::bn_list, cutter::boxnode::bn_piecelen, cutter::boxnode::bn_piecelist, rt_shootray_status::box_end, rt_shootray_status::box_num, rt_shootray_status::box_start, BU_ASSERT_PTR, BU_BITSET, BU_BITTEST, bu_bitv_clear(), BU_BITV_ZEROALL, BU_CK_PTBL, BU_GETSTRUCT, BU_LIST_DEQUEUE, BU_LIST_FIRST, BU_LIST_INIT, BU_LIST_IS_EMPTY, BU_LIST_MAGIC_WRONG, BU_LIST_UNINITIALIZED, bu_log(), bu_log_indent_delta(), BU_PTBL_GET, bu_ptbl_init(), bu_ptbl_ins_unique(), BU_PTBL_MAGIC, bu_ptbl_reset(), bu_ptbl_rm(), rt_shootray_status::curcut, rt_shootray_status::curmax, rt_shootray_status::curmin, CUT_BOXNODE, CUT_CUTNODE, CUT_NUGRIDNODE, cutter::cut_type, CUTTER_NULL, DEBUG_ALLHITS, DEBUG_ALLRAYS, DEBUG_PARTITION, DEBUG_SHOOT, rt_shootray_status::dist_corr, FAST, get_solidbitv(), INFINITY, rt_shootray_status::inv_dir, bu_ptbl::l, seg::l, rt_shootray_status::lastcell, rt_shootray_status::lastcut, MAGSQ, rt_i::mdl_max, rt_i::mdl_min, rt_shootray_status::model_end, rt_shootray_status::model_start, NEAR_ZERO, rt_i::needprep, rt_shootray_status::newray, rt_i::nsolids, cutter::nugridnode::nu_axis, cutter::nugridnode::nu_cells_per_axis, cutter::nugn, NULL, rt_shootray_status::obox_end, rt_shootray_status::obox_start, rt_shootray_status::odist_corr, rt_shootray_status::old_status, partition::pt_back, partition::pt_forw, PT_HD_MAGIC, partition::pt_magic, xray::r_max, xray::r_min, resource::re_cpu, resource::re_magic, resource::re_ndup, resource::re_nempty_cells, resource::re_nmiss_model, resource::re_nshootray, resource::re_parthead, resource::re_piece_shot_hit, resource::re_piece_shot_miss, resource::re_piece_shots, resource::re_pieces, resource::re_pieces_pending, resource::re_prune_solrpp, resource::re_region_ptbl, resource::re_shot_miss, resource::re_shots, RESOURCE_NULL, rt_shootray_status::resp, rt_shootray_status::rstep, rt_advance_to_next_cell(), RT_AP_CHECK, RT_AP_MAGIC, RT_BADVEC, rt_bomb(), RT_CK_AP, RT_CK_PIECELIST, RT_CK_PIECESTATE, RT_CK_RAY, RT_CK_RESOURCE, RT_CK_RTI, RT_CK_SOLTAB, rt_find_backing_dist(), RT_G_DEBUG, rt_htbl_reset(), rt_in_rpp(), rt_init_resource(), rt_pr_cut(), rt_prep_parallel(), RT_RAY_MAGIC, rt_res_pieces_init(), rt_uniresource, rt_i::rti_nsolids_with_pieces, rt_i::rti_resources, SQRT_SMALL_FASTF, soltab::st_bit, soltab::st_max, soltab::st_meth, soltab::st_min, soltab::st_piecestate_num, status, rt_piecelist::stp, V3ARGS, VMOVE, VPRINT, VSCALE, VSET, X, Y, and Z.

Here is the call graph for this function:

const union cutter* rt_cell_n_on_ray register struct application ap,
int  n
 

Definition at line 1464 of file shoot.c.

References rt_shootray_status::abs_inv_dir, rt_shootray_status::ap, BACKING_DIST, cutter::bn, cutter::boxnode::bn_len, rt_shootray_status::box_end, rt_shootray_status::box_start, BU_ASSERT_PTR, BU_LIST_UNINITIALIZED, bu_log(), bu_log_indent_delta(), BU_PTBL_GET, rt_shootray_status::curcut, rt_shootray_status::curmax, rt_shootray_status::curmin, CUT_BOXNODE, CUT_CUTNODE, CUT_NUGRIDNODE, cutter::cut_type, CUTTER_NULL, DEBUG_ALLRAYS, DEBUG_PARTITION, DEBUG_SHOOT, rt_shootray_status::dist_corr, FAST, INFINITY, rt_shootray_status::inv_dir, rt_shootray_status::lastcell, rt_shootray_status::lastcut, MAGSQ, rt_i::mdl_max, rt_i::mdl_min, rt_shootray_status::model_end, rt_shootray_status::model_start, NEAR_ZERO, rt_i::needprep, rt_shootray_status::newray, cutter::nugridnode::nu_axis, cutter::nugridnode::nu_cells_per_axis, cutter::nugn, NULL, rt_shootray_status::obox_end, rt_shootray_status::obox_start, rt_shootray_status::odist_corr, rt_shootray_status::old_status, resource::re_cpu, resource::re_magic, resource::re_parthead, RESOURCE_NULL, rt_shootray_status::resp, rt_shootray_status::rstep, rt_advance_to_next_cell(), RT_AP_CHECK, RT_AP_MAGIC, RT_BADVEC, rt_bomb(), RT_CK_AP, RT_CK_RAY, RT_CK_RESOURCE, RT_CK_RTI, RT_G_DEBUG, rt_in_rpp(), rt_init_resource(), rt_pr_cut(), rt_prep_parallel(), RT_RAY_MAGIC, rt_uniresource, rt_i::rti_resources, SQRT_SMALL_FASTF, V3ARGS, VMOVE, VPRINT, VSCALE, VSET, X, Y, and Z.

Here is the call graph for this function:

int rt_in_rpp struct xray rp,
register const fastf_t invdir,
register const fastf_t min,
register const fastf_t max
 

Definition at line 1703 of file shoot.c.

References INFINITY, xray::r_max, xray::r_min, xray::r_pt, and st.

int rt_DB_rpp register struct xray rp,
register const fastf_t invdir,
register const fastf_t min,
register const fastf_t max
 

Definition at line 1787 of file shoot.c.

References bu_log(), FAST, INFINITY, st, VPRINT, X, Y, and Z.

Here is the call graph for this function:

void rt_vstub struct soltab **  stp,
struct xray **  rp,
struct seg segp,
int  n,
struct application ap
 

Definition at line 1918 of file shoot.c.

References BU_LIST_INIT, seg::l, and SEG_MISS.

void rt_pr_library_version void   ) 
 

Definition at line 1953 of file shoot.c.

References bu_log(), and rt_version.

Here is the call graph for this function:

void rt_zero_res_stats struct resource resp  ) 
 

Definition at line 1959 of file shoot.c.

References resource::re_ndup, resource::re_nempty_cells, resource::re_nmiss_model, resource::re_nshootray, resource::re_piece_ndup, resource::re_piece_shot_hit, resource::re_piece_shot_miss, resource::re_piece_shots, resource::re_prune_solrpp, resource::re_shot_hit, resource::re_shot_miss, resource::re_shots, and RT_CK_RESOURCE.

Referenced by rt_add_res_stats().

void rt_add_res_stats register struct rt_i rtip,
register struct resource resp
 

Definition at line 1992 of file shoot.c.

References RESOURCE_NULL, RT_CK_RESOURCE, RT_CK_RTI, rt_uniresource, and rt_zero_res_stats().

Here is the call graph for this function:

void rt_3move_raydist FILE *  fp,
struct xray rayp,
double  dist
 

Definition at line 2019 of file shoot.c.

References pdv_3move(), xray::r_dir, xray::r_pt, and VJOIN1.

Here is the call graph for this function:

void rt_3cont_raydist FILE *  fp,
struct xray rayp,
double  dist
 

Definition at line 2028 of file shoot.c.

References pdv_3cont(), xray::r_dir, xray::r_pt, and VJOIN1.

Here is the call graph for this function:

int rt_shootray struct application ap  ) 
 

Definition at line 95 of file vshoot.c.

References application::a_level, application::a_purpose, application::a_ray, application::a_resource, application::a_rt_i, application::a_x, application::a_y, bu_calloc(), bu_log(), bzero, DEBUG_ALLRAYS, DEBUG_PARTITION, DEBUG_SHOOT, ID_MAX_SOLID, INFINITY, rt_i::mdl_max, rt_i::mdl_min, NEAR_ZERO, rt_i::needprep, rt_i::nmiss_model, rt_i::nsolids, partition::pt_back, partition::pt_forw, xray::r_dir, xray::r_max, xray::r_pt, resource::re_cpu, resource::re_magic, RESOURCE_MAGIC, RESOURCE_NULL, RT_AP_CHECK, RT_CK_RESOURCE, RT_G_DEBUG, rt_in_rpp(), rt_prep(), rt_uniresource, rt_i::rti_maxsol_by_type, rt_i::rti_nrays, rt_i::rti_nsol_by_type, rt_i::rti_sol_by_type, seg::seg_stp, SOLTAB_NULL, SQRT_SMALL_FASTF, status, VPRINT, X, Y, and Z.

Referenced by rt_shoot_many_rays_worker(), rt_smooth_bot(), rt_submodel_shot(), and rt_tcl_rt_shootray().

Here is the call graph for this function:

rt_vstub struct soltab stp[],
struct xray rp[],
struct seg  segp[],
int  n,
struct resource resp
 

Definition at line 359 of file vshoot.c.

References SEG_MISS.

rt_in_rpp struct xray rp,
fastf_t invdir,
fastf_t min,
fastf_t max
 

Definition at line 412 of file vshoot.c.

References FAST, INFINITY, xray::r_dir, xray::r_max, xray::r_min, xray::r_pt, st, X, Y, and Z.

void rt_bitv_or bitv_t out,
bitv_t in,
int  nbits
 

Definition at line 503 of file vshoot.c.

void rt_get_bitv struct rt_i rtip,
struct resource res
 

Definition at line 531 of file vshoot.c.

References bu_log(), bu_malloc(), bu_malloc_len_roundup(), and size.

Here is the call graph for this function:


Variable Documentation

struct resource rt_uniresource
 

default. Defined in librt/shoot.c

Definition at line 73 of file shoot.c.

struct resource rt_uniresource
 

default. Defined in librt/shoot.c

Definition at line 52 of file vshoot.c.


Generated on Mon Sep 18 01:25:46 2006 for BRL-CAD by  doxygen 1.4.6