bigE.c File Reference

#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <signal.h>
#include <strings.h>
#include <errno.h>
#include <time.h>
#include "machine.h"
#include "bu.h"
#include "vmath.h"
#include "nmg.h"
#include "rtgeom.h"
#include "raytrace.h"
#include "solid.h"
#include <ctype.h>

Include dependency graph for bigE.c:

Go to the source code of this file.

Data Structures

struct  dg_client_data
struct  half_specific
union  E_tree
struct  E_tree::E_node
struct  E_tree::E_leaf

Defines

#define ON_SURF   (struct soltab *)0x1
#define IN_SOL   (struct soltab *)0x2
#define ON_INT   (struct soltab *)0x3
#define NOT_SEG_OVERLAP(_a, _b)   ((_a->seg_out.hit_dist <= _b->seg_in.hit_dist) || (_b->seg_out.hit_dist <= _a->seg_in.hit_dist))
#define MY_FREE_SEG_LIST(_segheadp, _res)
#define HALF_NULL   ((struct half_specific *)0)
#define E_TREE_MAGIC   0x45545245
#define CK_ETREE(_p)   BU_CKMAG( _p, E_TREE_MAGIC, "struct E_tree" )
#define HITS_BLOCK   20

Functions

E_treebuild_etree (union tree *tp, struct dg_client_data *dgcdp)
void Edrawtree (int dp)
HIDDEN union E_treeadd_solid (const struct directory *dp, matp_t mat, struct dg_client_data *dgcdp)
void show_seg (struct bu_list *seg, int str)
HIDDEN void eliminate_overlaps (struct bu_list *seghead, struct dg_client_data *dgcdp)
HIDDEN void do_intersect (struct seg *A, struct seg *B, struct bu_list *seghead, struct soltab *type, struct dg_client_data *dgcdp)
HIDDEN void do_subtract (struct seg *A, struct seg *B, struct bu_list *seghead, struct dg_client_data *dgcdp)
HIDDEN void do_union (struct seg *A, struct seg *B, struct bu_list *seghead, struct dg_client_data *dgcdp)
HIDDEN void promote_ints (struct bu_list *head, struct dg_client_data *dgcdp)
HIDDEN struct bu_listeval_op (struct bu_list *A, int op, struct bu_list *B, struct dg_client_data *dgcdp)
HIDDEN struct bu_listeval_etree (union E_tree *eptr, struct dg_client_data *dgcdp)
HIDDEN void inverse_dir (vect_t dir, vect_t inv_dir)
HIDDEN struct soltabclassify_seg (struct seg *seg, struct soltab *shoot, struct xray *rp, struct dg_client_data *dgcdp)
HIDDEN void shoot_and_plot (point_t start_pt, vect_t dir, struct bu_list *vhead, fastf_t edge_len, int skip_leaf1, int skip_leaf2, union E_tree *eptr, struct soltab *type, struct dg_client_data *dgcdp)
HIDDEN void Eplot (union E_tree *eptr, struct bu_list *vhead, struct dg_client_data *dgcdp)
HIDDEN void free_etree (union E_tree *eptr, struct dg_client_data *dgcdp)
HIDDEN void fix_halfs (struct dg_client_data *dgcdp)
int dgo_E_cmd (struct dg_obj *dgop, Tcl_Interp *interp, int argc, char **argv)
int dgo_E_tcl (ClientData clientData, Tcl_Interp *interp, int argc, char **argv)


Detailed Description

This module implements the 'E' command.

Author - John Anderson

Modifications - Bob Parker - modified to live in librt's drawable geometry object.

Source - The U. S. Army Ballistic Research Laboratory Aberdeen Proving Ground, Maryland 21005-5066

Definition in file bigE.c.


Define Documentation

#define ON_SURF   (struct soltab *)0x1
 

Definition at line 85 of file bigE.c.

Referenced by classify_seg(), eval_op(), nmg_class_status(), promote_ints(), and show_seg().

#define IN_SOL   (struct soltab *)0x2
 

Definition at line 86 of file bigE.c.

Referenced by classify_seg(), eval_op(), and show_seg().

#define ON_INT   (struct soltab *)0x3
 

Definition at line 87 of file bigE.c.

Referenced by eval_op(), promote_ints(), and show_seg().

#define NOT_SEG_OVERLAP _a,
_b   )     ((_a->seg_out.hit_dist <= _b->seg_in.hit_dist) || (_b->seg_out.hit_dist <= _a->seg_in.hit_dist))
 

Definition at line 89 of file bigE.c.

Referenced by do_intersect(), do_subtract(), do_union(), eliminate_overlaps(), eval_op(), and promote_ints().

#define MY_FREE_SEG_LIST _segheadp,
_res   ) 
 

Value:

{ \
        register struct seg *_a; \
        while( BU_LIST_WHILE( _a, seg, (_segheadp) ) )  { \
                BU_LIST_DEQUEUE( &(_a->l) ); \
                RT_FREE_SEG( _a, _res ); \
        } }

Definition at line 92 of file bigE.c.

Referenced by eval_op(), free_etree(), and shoot_and_plot().

#define HALF_NULL   ((struct half_specific *)0)
 

Definition at line 105 of file bigE.c.

Referenced by rt_hlf_class(), and rt_hlf_print().

#define E_TREE_MAGIC   0x45545245
 

Definition at line 135 of file bigE.c.

Referenced by add_solid(), and build_etree().

#define CK_ETREE _p   )     BU_CKMAG( _p, E_TREE_MAGIC, "struct E_tree" )
 

Definition at line 136 of file bigE.c.

Referenced by Eplot(), eval_etree(), free_etree(), and shoot_and_plot().

#define HITS_BLOCK   20
 

Definition at line 1552 of file bigE.c.


Function Documentation

union E_tree * build_etree union tree tp,
struct dg_client_data dgcdp
 

Definition at line 302 of file bigE.c.

References add_solid(), bu_bomb(), BU_GETUNION, BU_LIST_INIT, db_lookup(), rt_wdb::dbip, dg_obj::dgo_wdbp, dg_client_data::dgop, DIR_NULL, E_TREE_MAGIC, E_tree::l, E_tree::E_node::left, LOOKUP_NOISY, E_tree::E_leaf::m, E_tree::magic, E_tree::n, NULL, E_tree::E_leaf::op, E_tree::E_node::op, OP_DB_LEAF, OP_INTERSECT, OP_NOP, OP_SOLID, OP_SUBTRACT, OP_UNION, E_tree::E_node::right, RT_CK_TREE, E_tree::E_leaf::seghead, soltab::st_dp, soltab::st_matp, tree::tree_node::tb_left, tree::tree_node::tb_right, tree::tree_db_leaf::tl_mat, tree::tree_db_leaf::tl_name, tree::tr_a, tree::tr_b, tree::tr_l, and tree::tree_leaf::tu_stp.

Referenced by add_solid(), and dgo_E_cmd().

Here is the call graph for this function:

void Edrawtree int  dp  ) 
 

Definition at line 139 of file bigE.c.

HIDDEN union E_tree* add_solid const struct directory dp,
matp_t  mat,
struct dg_client_data dgcdp
 

Definition at line 146 of file bigE.c.

References bu_free(), BU_GETSTRUCT, BU_GETUNION, BU_LIST_FIRST, bu_ptbl_ins(), build_etree(), DB5_MAJORTYPE_BRLCAD, rt_wdb::dbip, dg_obj::dgo_wdbp, dg_client_data::dgop, E_tree::E_leaf::do_not_free_model, dg_client_data::do_polysolids, E_TREE_MAGIC, ID_BOT, ID_COMBINATION, ID_HALF, ID_NMG, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, dg_client_data::interp, soltab::l, E_tree::l, soltab::l2, dg_client_data::leaf_list, E_tree::E_leaf::m, bu_list::magic, E_tree::magic, rt_bot_internal::mode, nmg_bot(), nmg_km(), nmg_mm(), NULL, dg_client_data::num_halfs, model::r_hd, RT_BOT_CK_MAGIC, RT_BOT_PLATE, RT_BOT_PLATE_NOCOS, RT_BOT_SOLID, RT_CK_COMB, rt_db_free_internal(), rt_db_get_internal(), RT_INIT_DB_INTERNAL, RT_SOLTAB2_MAGIC, RT_SOLTAB_MAGIC, rt_uniresource, dg_client_data::rtip, nmgregion::s_hd, soltab::st_dp, soltab::st_id, soltab::st_matp, soltab::st_meth, E_tree::E_leaf::stp, rt_comb_internal::tree, rt_wdb::wdb_tol, and rt_wdb::wdb_ttol.

Referenced by build_etree().

Here is the call graph for this function:

void show_seg struct bu_list seg,
int  str
 

Definition at line 352 of file bigE.c.

References BU_LIST_FOR, BU_LIST_IS_EMPTY, bu_log(), IN_SOL, ON_INT, ON_SURF, ptr, and V3ARGS.

Referenced by eval_etree(), eval_op(), and promote_ints().

Here is the call graph for this function:

HIDDEN void eliminate_overlaps struct bu_list seghead,
struct dg_client_data dgcdp
 

Definition at line 384 of file bigE.c.

References application::a_resource, dg_client_data::ap, BU_LIST_DEQUEUE, BU_LIST_FIRST, BU_LIST_IS_HEAD, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, hit::hit_dist, seg::l, NOT_SEG_OVERLAP, RT_FREE_SEG, seg::seg_in, and seg::seg_out.

Referenced by eval_op().

HIDDEN void do_intersect struct seg A,
struct seg B,
struct bu_list seghead,
struct soltab type,
struct dg_client_data dgcdp
 

Definition at line 424 of file bigE.c.

References A, application::a_resource, dg_client_data::ap, BU_LIST_INSERT, hit::hit_dist, seg::l, NOT_SEG_OVERLAP, NULL, RT_GET_SEG, seg::seg_in, seg::seg_out, seg::seg_stp, and type.

Referenced by eval_op().

HIDDEN void do_subtract struct seg A,
struct seg B,
struct bu_list seghead,
struct dg_client_data dgcdp
 

Definition at line 473 of file bigE.c.

References A, application::a_resource, dg_client_data::ap, BU_LIST_INSERT, hit::hit_dist, seg::l, NOT_SEG_OVERLAP, NULL, RT_GET_SEG, seg::seg_in, seg::seg_out, and seg::seg_stp.

Referenced by eval_op().

HIDDEN void do_union struct seg A,
struct seg B,
struct bu_list seghead,
struct dg_client_data dgcdp
 

Definition at line 533 of file bigE.c.

References A, application::a_resource, dg_client_data::ap, BU_LIST_INSERT, hit::hit_dist, seg::l, NOT_SEG_OVERLAP, RT_GET_SEG, seg::seg_in, and seg::seg_out.

HIDDEN void promote_ints struct bu_list head,
struct dg_client_data dgcdp
 

Definition at line 580 of file bigE.c.

References application::a_resource, dg_client_data::ap, BU_LIST_APPEND, BU_LIST_DEQUEUE, BU_LIST_FIRST, BU_LIST_FOR, BU_LIST_INSERT, BU_LIST_IS_HEAD, BU_LIST_NOT_HEAD, BU_LIST_PLAST, BU_LIST_PNEXT, bu_log(), head, hit::hit_dist, seg::l, NOT_SEG_OVERLAP, ON_INT, ON_SURF, RT_FREE_SEG, RT_GET_SEG, seg::seg_in, seg::seg_out, seg::seg_stp, and show_seg().

Referenced by eval_op().

Here is the call graph for this function:

HIDDEN struct bu_list* eval_op struct bu_list A,
int  op,
struct bu_list B,
struct dg_client_data dgcdp
 

Definition at line 813 of file bigE.c.

References A, application::a_resource, dg_client_data::ap, bu_free(), BU_LIST_APPEND, BU_LIST_DEQUEUE, BU_LIST_FIRST, BU_LIST_FOR, BU_LIST_INIT, BU_LIST_INSERT, BU_LIST_INSERT_LIST, BU_LIST_IS_EMPTY, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, BU_LIST_WHILE, bu_log(), do_intersect(), do_subtract(), eliminate_overlaps(), hit::hit_dist, IN_SOL, seg::l, MY_FREE_SEG_LIST, NOT_SEG_OVERLAP, ON_INT, ON_SURF, OP_INTERSECT, OP_SUBTRACT, OP_UNION, promote_ints(), RT_FREE_SEG, RT_GET_SEG, seg::seg_in, seg::seg_out, seg::seg_stp, and show_seg().

Referenced by eval_etree().

Here is the call graph for this function:

HIDDEN struct bu_list* eval_etree union E_tree eptr,
struct dg_client_data dgcdp
 

Definition at line 1162 of file bigE.c.

References A, BU_LIST_INIT, BU_LIST_INSERT_LIST, bu_log(), bu_malloc(), CK_ETREE, eval_op(), E_tree::l, E_tree::E_node::left, E_tree::n, NULL, E_tree::E_node::op, E_tree::E_leaf::op, OP_DB_LEAF, OP_INTERSECT, OP_SOLID, OP_SUBTRACT, OP_UNION, E_tree::E_node::right, E_tree::E_leaf::seghead, and show_seg().

Here is the call graph for this function:

HIDDEN void inverse_dir vect_t  dir,
vect_t  inv_dir
 

Definition at line 1204 of file bigE.c.

References INFINITY, NEAR_ZERO, SQRT_SMALL_FASTF, X, Y, and Z.

Referenced by classify_seg().

HIDDEN struct soltab* classify_seg struct seg seg,
struct soltab shoot,
struct xray rp,
struct dg_client_data dgcdp
 

Definition at line 1228 of file bigE.c.

References application::a_resource, dg_client_data::ap, ray_data::ap, bn_vec_ortho(), BU_GETSTRUCT, BU_LIST_DEQUEUE, BU_LIST_INIT, BU_LIST_WHILE, bu_log(), bzero, ray_data::classifying_ray, directory::d_namep, dg_obj::dgo_wdbp, dg_client_data::dgop, bn_tol::dist, hit::hit_dist, ray_data::hitmiss, IN_SOL, inverse_dir(), seg::l, ray_data::magic, NEAR_ZERO, NMG_RAY_DATA_MAGIC, NULL, ON_SURF, xray::r_dir, xray::r_pt, ray_data::rd_invdir, ray_data::rp, RT_FREE_SEG, seg::seg_in, seg::seg_out, ray_data::seghead, soltab::st_dp, soltab::st_id, ray_data::stp, ray_data::tol, V3ARGS, VJOIN1, and rt_wdb::wdb_tol.

Referenced by shoot_and_plot().

Here is the call graph for this function:

HIDDEN void shoot_and_plot point_t  start_pt,
vect_t  dir,
struct bu_list vhead,
fastf_t  edge_len,
int  skip_leaf1,
int  skip_leaf2,
union E_tree eptr,
struct soltab type,
struct dg_client_data dgcdp
 

Definition at line 1317 of file bigE.c.

References application::a_resource, dg_client_data::ap, ray_data::ap, bn_mat_identity, bn_mat_is_equal(), bu_debug, BU_DEBUG_MEM_CHECK, BU_GETSTRUCT, BU_LIST_DEQUEUE, BU_LIST_INIT, BU_LIST_INSERT, BU_LIST_NON_EMPTY, BU_LIST_WHILE, bu_log(), bu_mem_barriercheck(), BU_PTBL_END, BU_PTBL_GET, bzero, CK_ETREE, classify_seg(), ray_data::classifying_ray, dg_obj::dgo_wdbp, dg_client_data::dgop, hit::hit_dist, ray_data::hitmiss, INFINITY, E_tree::l, seg::l, dg_client_data::leaf_list, bu_list::magic, ray_data::magic, MY_FREE_SEG_LIST, NEAR_ZERO, NMG_RAY_DATA_MAGIC, NULL, xray::r_dir, xray::r_pt, ray_data::rd_hit, ray_data::rd_invdir, ray_data::rd_m, ray_data::rd_miss, ray_data::rp, RT_FREE_SEG, RT_GET_SEG, rt_in_rpp(), RT_SEG_MAGIC, seg::seg_in, seg::seg_out, seg::seg_stp, ray_data::seghead, SQRT_SMALL_FASTF, soltab::st_dp, soltab::st_matp, ray_data::stp, E_tree::E_leaf::stp, ray_data::tol, type, VMOVE, rt_wdb::wdb_tol, X, Y, and Z.

Here is the call graph for this function:

HIDDEN void Eplot union E_tree eptr,
struct bu_list vhead,
struct dg_client_data dgcdp
 

Definition at line 1555 of file bigE.c.

References BU_PTBL_END, BU_PTBL_GET, bu_ptbl_init(), CK_ETREE, dg_obj::dgo_wdbp, dg_client_data::dgop, E_tree::E_leaf::edge_list, dg_client_data::interp, E_tree::l, dg_client_data::leaf_list, E_tree::E_leaf::m, model::magic, nmg_edge_tabulate(), NULL, E_tree::E_leaf::op, OP_DB_LEAF, OP_SOLID, and rt_wdb::wdb_tol.

Referenced by dgo_E_cmd().

Here is the call graph for this function:

HIDDEN void free_etree union E_tree eptr,
struct dg_client_data dgcdp
 

Definition at line 1930 of file bigE.c.

References application::a_resource, dg_client_data::ap, bu_free(), BU_LIST_NON_EMPTY, bu_ptbl_free(), CK_ETREE, E_tree::l, E_tree::E_node::left, MY_FREE_SEG_LIST, E_tree::n, nmg_km(), NULL, E_tree::E_leaf::op, OP_DB_LEAF, OP_INTERSECT, OP_SOLID, OP_SUBTRACT, OP_UNION, and E_tree::E_node::right.

Referenced by dgo_E_cmd().

Here is the call graph for this function:

HIDDEN void fix_halfs struct dg_client_data dgcdp  ) 
 

Definition at line 1973 of file bigE.c.

References BU_PTBL_END, BU_PTBL_GET, dg_obj::dgo_wdbp, dg_client_data::dgop, ID_HALF, dg_client_data::leaf_list, MAX_FASTF, VMINMAX, VSETALL, and rt_wdb::wdb_tol.

Referenced by dgo_E_cmd().


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