BRL-CAD

The "raytrace instance" structure contains definitions for librt which are specific to the particular model being processed. More...

Collaboration diagram for The Raytracing Instance:

Files

file  rt_instance.h
 

Data Structures

struct  rt_i
 

Macros

#define RTI_NULL   ((struct rt_i *)0)
 
#define RT_CHECK_RTI(_p)   BU_CKMAG(_p, RTI_MAGIC, "struct rt_i")
 
#define RT_CK_RTI(_p)   RT_CHECK_RTI(_p)
 
#define RT_VISIT_ALL_SOLTABS_START(_s, _rti)
 
#define RT_VISIT_ALL_SOLTABS_END   } }
 

Functions

struct rt_irt_new_rti (struct db_i *dbip)
 
void rt_free_rti (struct rt_i *rtip)
 
void rt_prep (struct rt_i *rtip)
 
void rt_prep_parallel (struct rt_i *rtip, int ncpu)
 
int rt_gettree (struct rt_i *rtip, const char *node)
 
int rt_gettrees (struct rt_i *rtip, int argc, const char **argv, int ncpus)
 
int rt_gettrees_and_attrs (struct rt_i *rtip, const char **attrs, int argc, const char **argv, int ncpus)
 
DEPRECATED int rt_load_attrs (struct rt_i *rtip, char **attrs)
 
void rt_pr_partitions (const struct rt_i *rtip, const struct partition *phead, const char *title)
 
struct soltabrt_find_solid (const struct rt_i *rtip, const char *name)
 Find solid by leaf name. More...
 
void rt_init_resource (struct resource *resp, int cpu_num, struct rt_i *rtip)
 
void rt_clean_resource_basic (struct rt_i *rtip, struct resource *resp)
 
void rt_clean_resource (struct rt_i *rtip, struct resource *resp)
 
void rt_clean_resource_complete (struct rt_i *rtip, struct resource *resp)
 
int rt_plot_solid (FILE *fp, struct rt_i *rtip, const struct soltab *stp, struct resource *resp)
 
void rt_clean (struct rt_i *rtip)
 
int rt_del_regtree (struct rt_i *rtip, struct region *delregp, struct resource *resp)
 
void rt_ck (struct rt_i *rtip)
 
void rt_pr_tree_val (const union tree *tp, const struct partition *partp, int pr_name, int lvl)
 
void rt_pr_partition (const struct rt_i *rtip, const struct partition *pp)
 
void rt_pr_partition_vls (struct bu_vls *v, const struct rt_i *rtip, const struct partition *pp)
 
void rt_cut_it (struct rt_i *rtip, int ncpu)
 
void rt_fr_cut (struct rt_i *rtip, union cutter *cutp)
 
void rt_regionfix (struct rt_i *rtip)
 

Detailed Description

The "raytrace instance" structure contains definitions for librt which are specific to the particular model being processed.

Macro Definition Documentation

◆ RTI_NULL

#define RTI_NULL   ((struct rt_i *)0)

Definition at line 132 of file rt_instance.h.

◆ RT_CHECK_RTI

#define RT_CHECK_RTI (   _p)    BU_CKMAG(_p, RTI_MAGIC, "struct rt_i")

Definition at line 134 of file rt_instance.h.

◆ RT_CK_RTI

#define RT_CK_RTI (   _p)    RT_CHECK_RTI(_p)

Definition at line 135 of file rt_instance.h.

◆ RT_VISIT_ALL_SOLTABS_START

#define RT_VISIT_ALL_SOLTABS_START (   _s,
  _rti 
)
Value:
{ \
struct bu_list *_head = &((_rti)->rti_solidheads[0]); \
for (; _head < &((_rti)->rti_solidheads[RT_DBNHASH]); _head++) \
for (BU_LIST_FOR(_s, soltab, _head)) {
#define BU_LIST_FOR(p, structure, headp)
Definition: list.h:380
#define RT_DBNHASH
hash table is an array of linked lists with this many array pointer elements (Memory use for 32-bit: ...
Definition: defines.h:155
Definition: list.h:132
Definition: soltab.h:57

Macros to painlessly visit all the active solids. Serving suggestion:

RT_VISIT_ALL_SOLTABS_START(stp, rtip) { rt_pr_soltab(stp); } RT_VISIT_ALL_SOLTABS_END

Definition at line 144 of file rt_instance.h.

◆ RT_VISIT_ALL_SOLTABS_END

#define RT_VISIT_ALL_SOLTABS_END   } }

Definition at line 149 of file rt_instance.h.

Function Documentation

◆ rt_new_rti()

struct rt_i* rt_new_rti ( struct db_i dbip)

◆ rt_free_rti()

void rt_free_rti ( struct rt_i rtip)

◆ rt_prep()

void rt_prep ( struct rt_i rtip)

◆ rt_prep_parallel()

void rt_prep_parallel ( struct rt_i rtip,
int  ncpu 
)

◆ rt_gettree()

int rt_gettree ( struct rt_i rtip,
const char *  node 
)

User-called function to add a tree hierarchy to the displayed set.

This function is not multiply re-entrant.

Returns - 0 Ordinarily -1 On major error

Note: -2 returns from rt_gettrees_and_attrs are filtered.

◆ rt_gettrees()

int rt_gettrees ( struct rt_i rtip,
int  argc,
const char **  argv,
int  ncpus 
)

◆ rt_gettrees_and_attrs()

int rt_gettrees_and_attrs ( struct rt_i rtip,
const char **  attrs,
int  argc,
const char **  argv,
int  ncpus 
)

User-called function to add a set of tree hierarchies to the active set. Includes getting the indicated list of attributes and a bu_hash_tbl for use with the ORCA man regions. (stashed in the rt_i structure).

This function may run in parallel, but is not multiply re-entrant itself, because db_walk_tree() isn't multiply re-entrant.

Semaphores used for critical sections in parallel mode: RT_SEM_TREE ====> protects rti_solidheads[] lists, d_uses(solids) RT_SEM_RESULTS => protects HeadRegion, mdl_min/max, d_uses(reg), nregions RT_SEM_WORKER ==> (db_walk_dispatcher, from db_walk_tree) RT_SEM_STATS ===> nsolids

INPUTS:

rtip - RT instance pointer

attrs - attribute value set

argc - number of trees to get

argv - array of char pointers to the names of the tree tops

ncpus - number of cpus to use

Returns - 0 Ordinarily -1 On major error

◆ rt_load_attrs()

DEPRECATED int rt_load_attrs ( struct rt_i rtip,
char **  attrs 
)

◆ rt_pr_partitions()

void rt_pr_partitions ( const struct rt_i rtip,
const struct partition phead,
const char *  title 
)

◆ rt_find_solid()

struct soltab* rt_find_solid ( const struct rt_i rtip,
const char *  name 
)

Find solid by leaf name.

Given the (leaf) name of a solid, find the first occurrence of it in the solid list. Used mostly to find the light source. Returns soltab pointer, or RT_SOLTAB_NULL.

◆ rt_init_resource()

void rt_init_resource ( struct resource resp,
int  cpu_num,
struct rt_i rtip 
)

◆ rt_clean_resource_basic()

void rt_clean_resource_basic ( struct rt_i rtip,
struct resource resp 
)

◆ rt_clean_resource()

void rt_clean_resource ( struct rt_i rtip,
struct resource resp 
)

◆ rt_clean_resource_complete()

void rt_clean_resource_complete ( struct rt_i rtip,
struct resource resp 
)

◆ rt_plot_solid()

int rt_plot_solid ( FILE *  fp,
struct rt_i rtip,
const struct soltab stp,
struct resource resp 
)

◆ rt_clean()

void rt_clean ( struct rt_i rtip)

◆ rt_del_regtree()

int rt_del_regtree ( struct rt_i rtip,
struct region delregp,
struct resource resp 
)

◆ rt_ck()

void rt_ck ( struct rt_i rtip)

◆ rt_pr_tree_val()

void rt_pr_tree_val ( const union tree tp,
const struct partition partp,
int  pr_name,
int  lvl 
)

◆ rt_pr_partition()

void rt_pr_partition ( const struct rt_i rtip,
const struct partition pp 
)

◆ rt_pr_partition_vls()

void rt_pr_partition_vls ( struct bu_vls v,
const struct rt_i rtip,
const struct partition pp 
)

◆ rt_cut_it()

void rt_cut_it ( struct rt_i rtip,
int  ncpu 
)

Go through all the solids in the model, given the model mins and maxes, and generate a cutting tree. A strategy better than incrementally cutting each solid is to build a box node which contains everything in the model, and optimize it.

This is the main entry point into space partitioning from rt_prep().

◆ rt_fr_cut()

void rt_fr_cut ( struct rt_i rtip,
union cutter cutp 
)

Free a whole cut tree below the indicated node. The strategy we use here is to free everything BELOW the given node, so as not to clobber rti_CutHead !

◆ rt_regionfix()

void rt_regionfix ( struct rt_i rtip)

Apply any deltas to reg_regionid values to allow old applications that use the reg_regionid number to distinguish between different instances of the same prototype region.

Called once, from rt_prep(), before raytracing begins.