BRL-CAD

Intersection segment. More...

Collaboration diagram for The Segment Structure:

Files

file  seg.h
 

Data Structures

struct  seg
 

Macros

#define RT_SEG_NULL   ((struct seg *)0)
 
#define RT_CHECK_SEG(_p)   BU_CKMAG(_p, RT_SEG_MAGIC, "struct seg")
 
#define RT_CK_SEG(_p)   BU_CKMAG(_p, RT_SEG_MAGIC, "struct seg")
 
#define RT_GET_SEG(p, res)
 
#define RT_FREE_SEG(p, res)
 
#define RT_FREE_SEG_LIST(_segheadp, _res)
 

Functions

void rt_pr_seg (const struct seg *segp)
 
void rt_pr_seg_vls (struct bu_vls *, const struct seg *)
 

Detailed Description

Intersection segment.

A "seg" or segment is a low level in/out ray/shape intersection solution, derived by performing intersection calculations between a ray and a single object. Depending on the type of shape, a single ray may produce multiple segments when intersected with that shape. Unless the object happens to also be a top-level unioned object in the database, individual segments must be "woven" together using boolean hierarchies to obtain the final partitions which describe solid geometry along a ray. An individual segment may have either a positive or negative contribution to the "final" partition, depending on whether parent combs designate their children as unioned, intersected, or subtracted.

Macro Definition Documentation

◆ RT_SEG_NULL

#define RT_SEG_NULL   ((struct seg *)0)

Definition at line 65 of file seg.h.

◆ RT_CHECK_SEG

#define RT_CHECK_SEG (   _p)    BU_CKMAG(_p, RT_SEG_MAGIC, "struct seg")

Definition at line 67 of file seg.h.

◆ RT_CK_SEG

#define RT_CK_SEG (   _p)    BU_CKMAG(_p, RT_SEG_MAGIC, "struct seg")

Definition at line 68 of file seg.h.

◆ RT_GET_SEG

#define RT_GET_SEG (   p,
  res 
)
Value:
{ \
while (!BU_LIST_WHILE((p), seg, &((res)->re_seg)) || !(p)) \
rt_alloc_seg_block(res); \
BU_LIST_DEQUEUE(&((p)->l)); \
(p)->l.forw = (p)->l.back = BU_LIST_NULL; \
(p)->seg_in.hit_magic = (p)->seg_out.hit_magic = RT_HIT_MAGIC; \
res->re_segget++; \
}
#define BU_LIST_NULL
Definition: list.h:137
#define BU_LIST_WHILE(p, structure, headp)
Definition: list.h:424
#define RT_HIT_MAGIC
Definition: magic.h:178
Definition: seg.h:59

Definition at line 70 of file seg.h.

◆ RT_FREE_SEG

#define RT_FREE_SEG (   p,
  res 
)
Value:
{ \
RT_CHECK_SEG(p); \
BU_LIST_INSERT(&((res)->re_seg), &((p)->l)); \
res->re_segfree++; \
}

Definition at line 80 of file seg.h.

◆ RT_FREE_SEG_LIST

#define RT_FREE_SEG_LIST (   _segheadp,
  _res 
)
Value:
{ \
register struct seg *_a; \
while (BU_LIST_WHILE(_a, seg, &((_segheadp)->l))) { \
BU_LIST_DEQUEUE(&(_a->l)); \
RT_FREE_SEG(_a, _res); \
} \
}
struct bu_list l
Definition: seg.h:60

This could be BU_LIST_INSERT_LIST(&((_res)->re_seg), &((_segheadp)->l)) except for security of checking & counting each element this way.

Definition at line 92 of file seg.h.

Function Documentation

◆ rt_pr_seg()

void rt_pr_seg ( const struct seg segp)

◆ rt_pr_seg_vls()

void rt_pr_seg_vls ( struct bu_vls ,
const struct seg  
)