BRL-CAD
#include "common.h"
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "bu/debug.h"
#include "bu/getopt.h"
#include "vmath.h"
#include "nmg.h"
#include "rtgeom.h"
#include "rtfunc.h"
#include "./ged_private.h"
Include dependency graph for bigE.c:

Go to the source code of this file.

Data Structures

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

Macros

#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

union E_treebuild_etree (union tree *tp, struct _ged_client_data *dgcdp)
 
HIDDEN union E_treeadd_solid (const struct directory *dp, matp_t mat, struct _ged_client_data *dgcdp)
 
void show_seg (struct bu_list *seg, int str)
 
HIDDEN void eliminate_overlaps (struct bu_list *seghead, struct _ged_client_data *dgcdp)
 
HIDDEN void do_intersect (struct seg *A, struct seg *B, struct bu_list *seghead, struct soltab *type, struct _ged_client_data *dgcdp)
 
HIDDEN void do_subtract (struct seg *A, struct seg *B, struct bu_list *seghead, struct _ged_client_data *dgcdp)
 
HIDDEN void promote_ints (struct bu_list *head, struct _ged_client_data *dgcdp)
 
HIDDEN struct bu_listeval_op (struct bu_list *A, int op, struct bu_list *B, struct _ged_client_data *dgcdp)
 
HIDDEN struct bu_listeval_etree (union E_tree *eptr, struct _ged_client_data *dgcdp)
 
HIDDEN void inverse_dir (vect_t dir, vect_t inv_dir)
 
HIDDEN struct soltabclassify_seg (struct seg *segp, struct soltab *shoot, struct xray *rp, struct _ged_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 _ged_client_data *dgcdp)
 
HIDDEN void Eplot (union E_tree *eptr, struct bu_list *vhead, struct _ged_client_data *dgcdp)
 
HIDDEN void free_etree (union E_tree *eptr, struct _ged_client_data *dgcdp)
 
HIDDEN void fix_halfs (struct _ged_client_data *dgcdp)
 
int ged_E (struct ged *gedp, int argc, const char *argv[])
 

Detailed Description

This module implements the 'E' command.

Definition in file bigE.c.

Macro Definition Documentation

#define ON_SURF   (struct soltab *)0x1

Definition at line 50 of file bigE.c.

Referenced by classify_seg(), Eplot(), eval_op(), promote_ints(), shoot_and_plot(), and show_seg().

#define IN_SOL   (struct soltab *)0x2

Definition at line 51 of file bigE.c.

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

#define ON_INT   (struct soltab *)0x3

Definition at line 52 of file bigE.c.

Referenced by Eplot(), 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 54 of file bigE.c.

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

#define MY_FREE_SEG_LIST (   _segheadp,
  _res 
)
Value:
{ \
struct seg *_a; \
while (BU_LIST_WHILE (_a, seg, (_segheadp))) { \
BU_LIST_DEQUEUE(&(_a->l)); \
RT_FREE_SEG(_a, _res); \
} }
#define RT_FREE_SEG(p, res)
Definition: raytrace.h:389
Definition: raytrace.h:368
#define BU_LIST_WHILE(p, structure, hp)
Definition: list.h:410
#define BU_LIST_DEQUEUE(cur)
Definition: list.h:209

Definition at line 57 of file bigE.c.

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

#define HALF_NULL   ((struct half_specific *)0)

Definition at line 70 of file bigE.c.

#define E_TREE_MAGIC   0x45545245

Definition at line 103 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 104 of file bigE.c.

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

#define HITS_BLOCK   20

Definition at line 1346 of file bigE.c.

Referenced by Eplot().

Function Documentation

void show_seg ( struct bu_list seg,
int  str 
)

Definition at line 275 of file bigE.c.

References BU_LIST_FOR, BU_LIST_IS_EMPTY, bu_log(), hit::hit_dist, hit::hit_point, IN_SOL, ON_INT, ON_SURF, seg::seg_in, seg::seg_out, seg::seg_stp, and V3ARGS.

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

Here is the call graph for this function:

HIDDEN void eliminate_overlaps ( struct bu_list seghead,
struct _ged_client_data dgcdp 
)
HIDDEN void do_intersect ( struct seg A,
struct seg B,
struct bu_list seghead,
struct soltab type,
struct _ged_client_data dgcdp 
)
HIDDEN void do_subtract ( struct seg A,
struct seg B,
struct bu_list seghead,
struct _ged_client_data dgcdp 
)
HIDDEN void promote_ints ( struct bu_list head,
struct _ged_client_data dgcdp 
)

Definition at line 436 of file bigE.c.

References application::a_resource, _ged_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(), 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, show_seg(), and ZERO.

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 _ged_client_data dgcdp 
)
HIDDEN struct bu_list* eval_etree ( union E_tree eptr,
struct _ged_client_data dgcdp 
)

Definition at line 959 of file bigE.c.

References A, BU_ALLOC, BU_LIST_INIT, BU_LIST_INSERT_LIST, bu_log(), CK_ETREE, eval_op(), E_tree::l, E_tree::E_node::left, E_tree::n, 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().

Referenced by shoot_and_plot().

Here is the call graph for this function:

HIDDEN void inverse_dir ( vect_t  dir,
vect_t  inv_dir 
)

Definition at line 1001 of file bigE.c.

References X, Y, Z, and ZERO.

Referenced by classify_seg().

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 _ged_client_data dgcdp 
)
HIDDEN void free_etree ( union E_tree eptr,
struct _ged_client_data dgcdp 
)
int ged_E ( struct ged gedp,
int  argc,
const char *  argv[] 
)

Prepare object(s) for display

Definition at line 2026 of file bigE.c.

References _GED_BOOL_EVAL, _ged_drawH_part2(), application::a_resource, application::a_rt_i, _ged_client_data::ap, BU_ALLOC, bu_debug, BU_DEBUG_MEM_CHECK, bu_free(), bu_getopt(), BU_LIST_FOR, BU_LIST_INIT, BU_LIST_IS_INITIALIZED, bu_log(), bu_mem_barriercheck(), bu_optarg, bu_optind, bu_ptbl_free(), bu_ptbl_init(), bu_ptbl_reset(), bu_vls_printf(), bu_vls_trunc(), build_etree(), db_free_full_path(), db_string_to_path(), rt_wdb::dbip, dl_addToDisplay(), dl_erasePathFromDisplay(), _ged_client_data::dmode, _ged_client_data::do_polysolids, Eplot(), _ged_client_data::etime, fix_halfs(), free_etree(), _ged_client_data::freesolid, ged::freesolid, ged_drawable::gd_headDisplay, _ged_client_data::gdlp, GED_CHECK_ARGC_GT_0, GED_CHECK_DATABASE_OPEN, GED_CHECK_DRAWABLE, GED_ERROR, ged::ged_free_vlist_callback, ged::ged_gdp, GED_HELP, GED_OK, ged::ged_result_str, ged::ged_wdbp, _ged_client_data::gedp, rt_i::HeadRegion, _ged_client_data::leaf_list, _ged_client_data::num_halfs, _ged_client_data::nvectors, resource::re_magic, resource::re_nmgfree, region::reg_mater, region::reg_name, region::reg_treetop, RESOURCE_MAGIC, RT_APPLICATION_INIT, rt_clean(), rt_gettrees(), rt_new_rti(), rt_uniresource, rt_i::rti_tol, _ged_client_data::rtip, _ged_client_data::start_time, time(), _ged_client_data::transparency, db_tree_state::ts_mater, usage(), rt_i::useair, rt_wdb::wdb_tol, _ged_client_data::wireframe_color, and _ged_client_data::wireframe_color_override.

Here is the call graph for this function: