g_nmg.c File Reference

#include "common.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <strings.h>
#include "machine.h"
#include "vmath.h"
#include "db.h"
#include "nmg.h"
#include "raytrace.h"
#include "nurb.h"
#include "./debug.h"

Include dependency graph for g_nmg.c:

Go to the source code of this file.

Data Structures

struct  nmg_specific
struct  tmp_v
struct  disk_rt_list
struct  disk_model
struct  disk_nmgregion
struct  disk_nmgregion_a
struct  disk_shell
struct  disk_shell_a
struct  disk_face
struct  disk_face_g_plane
struct  disk_face_g_snurb
struct  disk_faceuse
struct  disk_loop
struct  disk_loop_g
struct  disk_loopuse
struct  disk_edge
struct  disk_edge_g_lseg
struct  disk_edge_g_cnurb
struct  disk_edgeuse
struct  disk_vertex
struct  disk_vertex_g
struct  disk_vertexuse
struct  disk_vertexuse_a_plane
struct  disk_vertexuse_a_cnurb
struct  disk_double_array
struct  nmg_exp_counts

Defines

#define NMG_SPEC_START_MAGIC   6014061
#define NMG_SPEC_END_MAGIC   7013061
#define RT_NMG_SEG_MISS(SEG)   (SEG).seg_stp=RT_SOLTAB_NULL
#define RT_CK_DISKMAGIC(_cp, _magic)
#define DISK_INDEX_NULL   0
#define DISK_INDEX_LISTHEAD   -1
#define DISK_MODEL_VERSION   1
#define DISK_MODEL_MAGIC   0x4e6d6f64
#define DISK_REGION_MAGIC   0x4e726567
#define DISK_REGION_A_MAGIC   0x4e725f61
#define DISK_SHELL_MAGIC   0x4e73686c
#define DISK_SHELL_A_MAGIC   0x4e735f61
#define DISK_FACE_MAGIC   0x4e666163
#define DISK_FACE_G_PLANE_MAGIC   0x4e666770
#define DISK_FACE_G_SNURB_MAGIC   0x4e666773
#define DISK_FACEUSE_MAGIC   0x4e667520
#define DISK_LOOP_MAGIC   0x4e6c6f70
#define DISK_LOOP_G_MAGIC   0x4e6c5f67
#define DISK_LOOPUSE_MAGIC   0x4e6c7520
#define DISK_EDGE_MAGIC   0x4e656467
#define DISK_EDGE_G_LSEG_MAGIC   0x4e65676c
#define DISK_EDGE_G_CNURB_MAGIC   0x4e656763
#define DISK_EDGEUSE_MAGIC   0x4e657520
#define DISK_VERTEX_MAGIC   0x4e767274
#define DISK_VERTEX_G_MAGIC   0x4e765f67
#define DISK_VERTEXUSE_MAGIC   0x4e767520
#define DISK_VERTEXUSE_A_PLANE_MAGIC   0x4e767561
#define DISK_VERTEXUSE_A_CNURB_MAGIC   0x4e766163
#define DISK_DOUBLE_ARRAY_MAGIC   0x4e666172
#define NMG_KIND_MODEL   0
#define NMG_KIND_NMGREGION   1
#define NMG_KIND_NMGREGION_A   2
#define NMG_KIND_SHELL   3
#define NMG_KIND_SHELL_A   4
#define NMG_KIND_FACEUSE   5
#define NMG_KIND_FACE   6
#define NMG_KIND_FACE_G_PLANE   7
#define NMG_KIND_FACE_G_SNURB   8
#define NMG_KIND_LOOPUSE   9
#define NMG_KIND_LOOP   10
#define NMG_KIND_LOOP_G   11
#define NMG_KIND_EDGEUSE   12
#define NMG_KIND_EDGE   13
#define NMG_KIND_EDGE_G_LSEG   14
#define NMG_KIND_EDGE_G_CNURB   15
#define NMG_KIND_VERTEXUSE   16
#define NMG_KIND_VERTEXUSE_A_PLANE   17
#define NMG_KIND_VERTEXUSE_A_CNURB   18
#define NMG_KIND_VERTEX   19
#define NMG_KIND_VERTEX_G   20
#define NMG_KIND_DOUBLE_ARRAY   25
#define NMG_N_KINDS   26
#define INDEX(o, i, elem)   (void)bu_plong(&(o)->elem[0], rt_nmg_reindex((genptr_t)((i)->elem), ecnt))
#define INDEXL(oo, ii, elem)
#define PUTMAGIC(_magic)   (void)bu_plong( &d->magic[0], _magic )
#define INDEX(o, i, ty, elem)   (i)->elem = (struct ty *)ptrs[bu_glong((o)->elem)]
#define INDEXL_HD(oo, ii, elem, hd)
#define INDEXL_HD2(oo, ii, elem, hd)

Typedefs

typedef unsigned char disk_index_t [4]

Functions

int rt_nmg_prep (struct soltab *stp, struct rt_db_internal *ip, struct rt_i *rtip)
void rt_nmg_print (register const struct soltab *stp)
int rt_nmg_shot (struct soltab *stp, register struct xray *rp, struct application *ap, struct seg *seghead)
void rt_nmg_vshot (struct soltab **stp, struct xray **rp, struct seg *segp, int n, struct application *ap)
void rt_nmg_norm (register struct hit *hitp, struct soltab *stp, register struct xray *rp)
void rt_nmg_curve (register struct curvature *cvp, register struct hit *hitp, struct soltab *stp)
void rt_nmg_uv (struct application *ap, struct soltab *stp, register struct hit *hitp, register struct uvcoord *uvp)
void rt_nmg_free (register struct soltab *stp)
int rt_nmg_class (void)
int rt_nmg_plot (struct bu_list *vhead, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
int rt_nmg_tess (struct nmgregion **r, struct model *m, struct rt_db_internal *ip, const struct rt_tess_tol *ttol, const struct bn_tol *tol)
int rt_nmg_magic_to_kind (register long int magic)
int rt_nmg_export_fastf (const fastf_t *fp, int count, int pt_type, double scale)
fastf_trt_nmg_import_fastf (const unsigned char *base, struct nmg_exp_counts *ecnt, long int subscript, const matp_t mat, int len, int pt_type)
int rt_nmg_reindex (genptr_t p, struct nmg_exp_counts *ecnt)
void rt_nmg_edisk (genptr_t op, genptr_t ip, struct nmg_exp_counts *ecnt, int index, double local2mm)
int rt_nmg_idisk (genptr_t op, genptr_t ip, struct nmg_exp_counts *ecnt, int index, long int **ptrs, const fastf_t *mat, const unsigned char *basep)
modelrt_nmg_ialloc (long int **ptrs, struct nmg_exp_counts *ecnt, int *kind_counts)
void rt_nmg_i2alloc (struct nmg_exp_counts *ecnt, unsigned char *cp, int *kind_counts, int maxindex)
int rt_nmg_import_internal (struct rt_db_internal *ip, const struct bu_external *ep, register const fastf_t *mat, int rebound, const struct bn_tol *tol)
int rt_nmg_export_internal (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, int compact)
int rt_nmg_import (struct rt_db_internal *ip, const struct bu_external *ep, register const fastf_t *mat, const struct db_i *dbip)
int rt_nmg_import5 (struct rt_db_internal *ip, struct bu_external *ep, register const mat_t mat, const struct db_i *dbip)
int rt_nmg_export (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip)
int rt_nmg_export5 (struct bu_external *ep, const struct rt_db_internal *ip, double local2mm, const struct db_i *dbip)
int rt_nmg_describe (struct bu_vls *str, const struct rt_db_internal *ip, int verbose, double mm2local)
void rt_nmg_ifree (struct rt_db_internal *ip)
int rt_nmg_tclget (Tcl_Interp *interp, const struct rt_db_internal *intern, const char *attr)
int rt_nmg_tcladjust (Tcl_Interp *interp, struct rt_db_internal *intern, int argc, char **argv, struct resource *resp)
void rt_nmg_make (const struct rt_functab *ftp, struct rt_db_internal *intern, double d)

Variables

const int rt_nmg_disk_sizes [NMG_N_KINDS]
const char rt_nmg_kind_names [NMG_N_KINDS+2][18]


Detailed Description

Intersect a ray with an NMG solid.

Authors -

Source - SECAD/VLD Computing Consortium, Bldg 394 The U. S. Army Ballistic Research Laboratory Aberdeen Proving Ground, Maryland 21005-5066

Definition in file g_nmg.c.


Define Documentation

#define NMG_SPEC_START_MAGIC   6014061
 

Definition at line 63 of file g_nmg.c.

Referenced by rt_nmg_prep(), and rt_nmg_shot().

#define NMG_SPEC_END_MAGIC   7013061
 

Definition at line 64 of file g_nmg.c.

Referenced by rt_nmg_prep(), and rt_nmg_shot().

#define RT_NMG_SEG_MISS SEG   )     (SEG).seg_stp=RT_SOLTAB_NULL
 

Definition at line 253 of file g_nmg.c.

#define RT_CK_DISKMAGIC _cp,
_magic   ) 
 

Value:

if( bu_glong(_cp) != _magic )  { \
                bu_log("RT_CK_DISKMAGIC: magic mis-match, got x%x, s/b x%x, file %s, line %d\n", \
                        bu_glong(_cp), _magic, __FILE__, __LINE__); \
                rt_bomb("bad magic\n"); \
        }

Definition at line 414 of file g_nmg.c.

Referenced by rt_nmg_idisk().

#define DISK_INDEX_NULL   0
 

Definition at line 430 of file g_nmg.c.

#define DISK_INDEX_LISTHEAD   -1
 

Definition at line 431 of file g_nmg.c.

Referenced by rt_nmg_reindex().

#define DISK_MODEL_VERSION   1
 

Definition at line 433 of file g_nmg.c.

Referenced by rt_nmg_import5(), and rt_nmg_import_internal().

#define DISK_MODEL_MAGIC   0x4e6d6f64
 

Definition at line 441 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_REGION_MAGIC   0x4e726567
 

Definition at line 448 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_REGION_A_MAGIC   0x4e725f61
 

Definition at line 457 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_SHELL_MAGIC   0x4e73686c
 

Definition at line 464 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_SHELL_A_MAGIC   0x4e735f61
 

Definition at line 476 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACE_MAGIC   0x4e666163
 

Definition at line 483 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACE_G_PLANE_MAGIC   0x4e666770
 

Definition at line 492 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACE_G_SNURB_MAGIC   0x4e666773
 

Definition at line 499 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_FACEUSE_MAGIC   0x4e667520
 

Definition at line 515 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_LOOP_MAGIC   0x4e6c6f70
 

Definition at line 527 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_LOOP_G_MAGIC   0x4e6c5f67
 

Definition at line 534 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_LOOPUSE_MAGIC   0x4e6c7520
 

Definition at line 541 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGE_MAGIC   0x4e656467
 

Definition at line 553 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGE_G_LSEG_MAGIC   0x4e65676c
 

Definition at line 560 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGE_G_CNURB_MAGIC   0x4e656763
 

Definition at line 568 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_EDGEUSE_MAGIC   0x4e657520
 

Definition at line 580 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEX_MAGIC   0x4e767274
 

Definition at line 595 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEX_G_MAGIC   0x4e765f67
 

Definition at line 602 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEXUSE_MAGIC   0x4e767520
 

Definition at line 608 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEXUSE_A_PLANE_MAGIC   0x4e767561
 

Definition at line 617 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_VERTEXUSE_A_CNURB_MAGIC   0x4e766163
 

Definition at line 623 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define DISK_DOUBLE_ARRAY_MAGIC   0x4e666172
 

Definition at line 629 of file g_nmg.c.

Referenced by rt_nmg_export_fastf(), and rt_nmg_import_fastf().

#define NMG_KIND_MODEL   0
 

Definition at line 638 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_NMGREGION   1
 

Definition at line 639 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_NMGREGION_A   2
 

Definition at line 640 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_SHELL   3
 

Definition at line 641 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_SHELL_A   4
 

Definition at line 642 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_FACEUSE   5
 

Definition at line 643 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_FACE   6
 

Definition at line 644 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_FACE_G_PLANE   7
 

Definition at line 645 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_FACE_G_SNURB   8
 

Definition at line 646 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_LOOPUSE   9
 

Definition at line 647 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_LOOP   10
 

Definition at line 648 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_LOOP_G   11
 

Definition at line 649 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_EDGEUSE   12
 

Definition at line 650 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_EDGE   13
 

Definition at line 651 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_EDGE_G_LSEG   14
 

Definition at line 652 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_EDGE_G_CNURB   15
 

Definition at line 653 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEXUSE   16
 

Definition at line 654 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEXUSE_A_PLANE   17
 

Definition at line 655 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEXUSE_A_CNURB   18
 

Definition at line 656 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEX   19
 

Definition at line 657 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_VERTEX_G   20
 

Definition at line 658 of file g_nmg.c.

Referenced by rt_nmg_edisk(), rt_nmg_ialloc(), rt_nmg_idisk(), and rt_nmg_magic_to_kind().

#define NMG_KIND_DOUBLE_ARRAY   25
 

Definition at line 661 of file g_nmg.c.

Referenced by rt_nmg_i2alloc(), rt_nmg_ialloc(), and rt_nmg_import_fastf().

#define NMG_N_KINDS   26
 

Definition at line 665 of file g_nmg.c.

Referenced by rt_nmg_export_internal(), rt_nmg_i2alloc(), rt_nmg_ialloc(), and rt_nmg_import_internal().

#define INDEX o,
i,
elem   )     (void)bu_plong(&(o)->elem[0], rt_nmg_reindex((genptr_t)((i)->elem), ecnt))
 

Definition at line 1360 of file g_nmg.c.

Referenced by rt_nmg_edisk(), and rt_nmg_idisk().

#define INDEXL oo,
ii,
elem   ) 
 

Value:

{ \
        register long _f = rt_nmg_reindex((genptr_t)((ii)->elem.forw), ecnt); \
        if( _f == DISK_INDEX_NULL )  bu_log("Warning rt_nmg_edisk: reindex forw to null?\n"); \
        (void)bu_plong( (oo)->elem.forw, _f ); \
        (void)bu_plong( (oo)->elem.back, rt_nmg_reindex((genptr_t)((ii)->elem.back), ecnt) ); }

Definition at line 997 of file g_nmg.c.

Referenced by rt_nmg_edisk().

#define PUTMAGIC _magic   )     (void)bu_plong( &d->magic[0], _magic )
 

Definition at line 1002 of file g_nmg.c.

Referenced by rt_nmg_edisk().

#define INDEX o,
i,
ty,
elem   )     (i)->elem = (struct ty *)ptrs[bu_glong((o)->elem)]
 

Definition at line 1360 of file g_nmg.c.

#define INDEXL_HD oo,
ii,
elem,
hd   ) 
 

Value:

{ \
        register int    sub; \
        if( (sub = bu_glong((oo)->elem.forw)) < 0 ) \
                (ii)->elem.forw = &(hd); \
        else    (ii)->elem.forw = (struct bu_list *)ptrs[sub]; \
        if( (sub = bu_glong((oo)->elem.back)) < 0 ) \
                (ii)->elem.back = &(hd); \
        else    (ii)->elem.back = (struct bu_list *)ptrs[sub]; }

Definition at line 1361 of file g_nmg.c.

Referenced by rt_nmg_idisk().

#define INDEXL_HD2 oo,
ii,
elem,
hd   ) 
 

Value:

{ \
        register int    sub; \
        register struct edgeuse *eu2; \
        if( (sub = bu_glong((oo)->elem.forw)) < 0 ) { \
                (ii)->elem.forw = &(hd); \
        } else { \
                eu2 = (struct edgeuse *)ptrs[sub]; \
                NMG_CK_EDGEUSE(eu2); \
                (ii)->elem.forw = &eu2->l2; \
        } \
        if( (sub = bu_glong((oo)->elem.back)) < 0 ) { \
                (ii)->elem.back = &(hd); \
        } else { \
                eu2 = (struct edgeuse *)ptrs[sub]; \
                NMG_CK_EDGEUSE(eu2); \
                (ii)->elem.back = &eu2->l2; \
        } }

Definition at line 1372 of file g_nmg.c.

Referenced by rt_nmg_idisk().


Typedef Documentation

typedef unsigned char disk_index_t[4]
 

Definition at line 435 of file g_nmg.c.


Function Documentation

int rt_nmg_prep struct soltab stp,
struct rt_db_internal ip,
struct rt_i rtip
 

R T _ N M G _ P R E P

Given a pointer to a ged database record, and a transformation matrix, determine if this is a valid nmg, and if so, precompute various terms of the formula.

returns - 0 nmg is ok !0 error in description

implicit return - a struct nmg_specific is created, and it's address is stored in stp->st_specific for use by nmg_shot().

Definition at line 97 of file g_nmg.c.

References BU_GETSTRUCT, BU_LIST_FOR, rt_db_internal::idb_ptr, MAGNITUDE, nmg_specific::manifolds, MAX_FASTF, nmgregion_a::max_pt, nmgregion_a::min_pt, NMG_CK_MODEL, NMG_CK_REGION, NMG_CK_REGION_A, nmg_ck_vs_in_region(), nmg_specific::nmg_emagic, nmg_manifolds(), nmg_specific::nmg_model, nmg_specific::nmg_smagic, NMG_SPEC_END_MAGIC, NMG_SPEC_START_MAGIC, NULL, model::r_hd, nmgregion::ra_p, RT_CK_DB_INTERNAL, rt_i::rti_tol, soltab::st_aradius, soltab::st_bradius, soltab::st_center, soltab::st_max, soltab::st_min, soltab::st_specific, VADD2SCALE, VMINMAX, VSETALL, and VSUB2SCALE.

Here is the call graph for this function:

void rt_nmg_print register const struct soltab stp  ) 
 

R T _ N M G _ P R I N T

Definition at line 149 of file g_nmg.c.

References NMG_CK_MODEL, and nmg_pr_m().

Here is the call graph for this function:

int rt_nmg_shot struct soltab stp,
register struct xray rp,
struct application ap,
struct seg seghead
 

R T _ N M G _ S H O T

Intersect a ray with a nmg. If an intersection occurs, a struct seg will be acquired and filled in.

Returns - 0 MISS >0 HIT

Definition at line 172 of file g_nmg.c.

References application::a_rt_i, ray_data::ap, bu_calloc(), bu_free(), BU_LIST_INIT, bu_log(), ray_data::classifying_ray, DEBUG_NMGRT, ray_data::hitmiss, INFINITY, ray_data::magic, nmg_specific::manifolds, ray_data::manifolds, model::maxindex, NEAR_ZERO, nmg_specific::nmg_emagic, nmg_specific::nmg_invdir, nmg_isect_ray_model(), nmg_specific::nmg_model, NMG_RAY_DATA_MAGIC, nmg_ray_segs(), nmg_specific::nmg_smagic, NMG_SPEC_END_MAGIC, NMG_SPEC_START_MAGIC, ray_data::rd_hit, ray_data::rd_invdir, ray_data::rd_m, ray_data::rd_miss, ray_data::rp, rt_bomb(), rt_pr_tol(), rt_i::rti_tol, ray_data::seghead, SQRT_SMALL_FASTF, soltab::st_specific, status, ray_data::stp, ray_data::tol, VMOVE, X, Y, and Z.

Here is the call graph for this function:

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

R T _ N M G _ V S H O T

Vectorized version.

Definition at line 261 of file g_nmg.c.

References rt_vstub().

Here is the call graph for this function:

void rt_nmg_norm register struct hit hitp,
struct soltab stp,
register struct xray rp
 

R T _ N M G _ N O R M

Given ONE ray distance, return the normal and entry/exit point.

Definition at line 277 of file g_nmg.c.

References VJOIN1.

void rt_nmg_curve register struct curvature cvp,
register struct hit hitp,
struct soltab stp
 

R T _ N M G _ C U R V E

Return the curvature of the nmg.

Definition at line 288 of file g_nmg.c.

References bn_vec_ortho().

Here is the call graph for this function:

void rt_nmg_uv struct application ap,
struct soltab stp,
register struct hit hitp,
register struct uvcoord uvp
 

R T _ N M G _ U V

For a hit on the surface of an nmg, return the (u,v) coordinates of the hit point, 0 <= u,v <= 1. u = azimuth v = elevation

Definition at line 308 of file g_nmg.c.

void rt_nmg_free register struct soltab stp  ) 
 

R T _ N M G _ F R E E

Definition at line 318 of file g_nmg.c.

References bu_free(), nmg_km(), and nmg_specific::nmg_model.

Here is the call graph for this function:

int rt_nmg_class void   ) 
 

R T _ N M G _ C L A S S

Definition at line 331 of file g_nmg.c.

int rt_nmg_plot struct bu_list vhead,
struct rt_db_internal ip,
const struct rt_tess_tol ttol,
const struct bn_tol tol
 

R T _ N M G _ P L O T

Definition at line 341 of file g_nmg.c.

References rt_db_internal::idb_ptr, LOCAL, NMG_CK_MODEL, nmg_m_to_vlist(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_nmg_tess struct nmgregion **  r,
struct model m,
struct rt_db_internal ip,
const struct rt_tess_tol ttol,
const struct bn_tol tol
 

R T _ N M G _ T E S S

XXX This routine "destroys" the internal nmg solid. This means that once you tesselate an NMG solid, your in-memory copy becomes invalid, and you can't do anything else with it until you get a new copy from disk.

Returns - -1 failure 0 OK. *r points to nmgregion that holds this tessellation.

Definition at line 367 of file g_nmg.c.

References BU_LIST_FIRST, BU_LIST_IS_EMPTY, BU_LIST_NEXT_NOT_HEAD, BU_LIST_NOT_HEAD, BU_LIST_PNEXT, GENPTR_NULL, rt_db_internal::idb_ptr, nmgregion::l, LOCAL, NMG_CK_MODEL, NMG_CK_REGION, nmg_merge_models(), nmg_merge_regions(), NULL, model::r_hd, and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_nmg_magic_to_kind register long int  magic  ) 
 

R T _ N M G _ M A G I C _ T O _ K I N D

Given the magic number for an NMG structure, return the manifest constant which identifies that structure kind.

Definition at line 733 of file g_nmg.c.

References bu_log(), NMG_EDGE_G_CNURB_MAGIC, NMG_EDGE_G_LSEG_MAGIC, NMG_EDGE_MAGIC, NMG_EDGEUSE_MAGIC, NMG_FACE_G_PLANE_MAGIC, NMG_FACE_G_SNURB_MAGIC, NMG_FACE_MAGIC, NMG_FACEUSE_MAGIC, NMG_KIND_EDGE, NMG_KIND_EDGE_G_CNURB, NMG_KIND_EDGE_G_LSEG, NMG_KIND_EDGEUSE, NMG_KIND_FACE, NMG_KIND_FACE_G_PLANE, NMG_KIND_FACE_G_SNURB, NMG_KIND_FACEUSE, NMG_KIND_LOOP, NMG_KIND_LOOP_G, NMG_KIND_LOOPUSE, NMG_KIND_MODEL, NMG_KIND_NMGREGION, NMG_KIND_NMGREGION_A, NMG_KIND_SHELL, NMG_KIND_SHELL_A, NMG_KIND_VERTEX, NMG_KIND_VERTEX_G, NMG_KIND_VERTEXUSE, NMG_KIND_VERTEXUSE_A_CNURB, NMG_KIND_VERTEXUSE_A_PLANE, NMG_LOOP_G_MAGIC, NMG_LOOP_MAGIC, NMG_LOOPUSE_MAGIC, NMG_MODEL_MAGIC, NMG_REGION_A_MAGIC, NMG_REGION_MAGIC, NMG_SHELL_A_MAGIC, NMG_SHELL_MAGIC, NMG_VERTEX_G_MAGIC, NMG_VERTEX_MAGIC, NMG_VERTEXUSE_A_CNURB_MAGIC, NMG_VERTEXUSE_A_PLANE_MAGIC, NMG_VERTEXUSE_MAGIC, and rt_bomb().

Here is the call graph for this function:

int rt_nmg_export_fastf const fastf_t fp,
int  count,
int  pt_type,
double  scale
 

R T _ N M G _ E X P O R T _ F A S T F

Format a variable sized array of fastf_t's into external format (IEEE big endian double precision) with a 2 element header.

+-----------+ | magic | +-----------+ | count | +-----------+ | | ~ doubles ~ ~ : ~ | | +-----------+

Increments the pointer to the next free byte in the external array, and increments the subscript number of the next free array.

Note that this subscript number is consistent with the rest of the NMG external subscript numbering, so that the first disk_double_array subscript will be one larger than the largest disk_vertex_g subscript, and in the external record the array of fastf_t arrays will follow the array of disk_vertex_g structures.

Returns - subscript number of this array, in the external form.

Definition at line 829 of file g_nmg.c.

References bu_free(), bu_malloc(), bu_plong(), DISK_DOUBLE_ARRAY_MAGIC, htond(), RT_NURB_EXTRACT_COORDS, RT_NURB_IS_PT_RATIONAL, void(), and VSCALEN.

Referenced by rt_nmg_edisk().

Here is the call graph for this function:

fastf_t* rt_nmg_import_fastf const unsigned char *  base,
struct nmg_exp_counts ecnt,
long int  subscript,
const matp_t  mat,
int  len,
int  pt_type
 

R T _ N M G _ I M P O R T _ F A S T F

Definition at line 876 of file g_nmg.c.

References bu_glong(), bu_log(), bu_malloc(), nmg_exp_counts::byte_offset, DISK_DOUBLE_ARRAY_MAGIC, MAT4X3PNT, MAT4X4PNT, NMG_KIND_DOUBLE_ARRAY, ntohd(), rt_bomb(), RT_NURB_EXTRACT_COORDS, and RT_NURB_IS_PT_RATIONAL.

Referenced by rt_nmg_idisk().

Here is the call graph for this function:

int rt_nmg_reindex genptr_t  p,
struct nmg_exp_counts ecnt
 

R T _ N M G _ R E I N D E X

Depends on ecnt[0].byte_offset having been set to maxindex.

There are some special values for the disk index returned here: >0 normal structure index. 0 substitute a null pointer when imported. -1 substitute pointer to within-struct list head when imported.

Definition at line 959 of file g_nmg.c.

References bu_identify_magic(), bu_log(), DISK_INDEX_LISTHEAD, index, nmg_exp_counts::new_subscript, nmg_index_of_struct(), and rt_bomb().

Referenced by rt_nmg_edisk().

Here is the call graph for this function:

void rt_nmg_edisk genptr_t  op,
genptr_t  ip,
struct nmg_exp_counts ecnt,
int  index,
double  local2mm
 

R T _ N M G _ E D I S K

Export a given structure from memory to disk format

Scale geometry by 'local2mm'

Definition at line 1012 of file g_nmg.c.

References vertexuse::a, bu_log(), bu_plong(), edge_g_cnurb::c_size, vertex_g::coord, edge_g_cnurb::ctl_points, face_g_snurb::ctl_points, DISK_EDGE_G_CNURB_MAGIC, DISK_EDGE_G_LSEG_MAGIC, DISK_EDGE_MAGIC, DISK_EDGEUSE_MAGIC, DISK_FACE_G_PLANE_MAGIC, DISK_FACE_G_SNURB_MAGIC, DISK_FACE_MAGIC, DISK_FACEUSE_MAGIC, DISK_LOOP_G_MAGIC, DISK_LOOP_MAGIC, DISK_LOOPUSE_MAGIC, DISK_MODEL_MAGIC, DISK_REGION_A_MAGIC, DISK_REGION_MAGIC, DISK_SHELL_A_MAGIC, DISK_SHELL_MAGIC, DISK_VERTEX_G_MAGIC, DISK_VERTEX_MAGIC, DISK_VERTEXUSE_A_CNURB_MAGIC, DISK_VERTEXUSE_A_PLANE_MAGIC, DISK_VERTEXUSE_MAGIC, disk_loopuse::down_hd, edge_g_lseg::e_dir, disk_edgeuse::e_p, edge_g_lseg::e_pt, disk_shell::eu_hd, disk_edge_g_cnurb::eu_hd2, disk_edge_g_lseg::eu_hd2, disk_edge::eu_p, disk_edgeuse::eumate_p, disk_face_g_snurb::f_hd, disk_face_g_plane::f_hd, disk_faceuse::f_p, faceuse::f_p, face::flip, disk_shell::fu_hd, disk_face::fu_p, disk_faceuse::fumate_p, faceuse::fumate_p, edgeuse::g, face::g, htond(), INDEX, INDEXL, edge::is_real, edge_g_cnurb::k, knot_vector::k_size, knot_vector::knots, disk_vertexuse::l, disk_edgeuse::l, disk_loopuse::l, disk_face::l, disk_faceuse::l, disk_shell::l, disk_nmgregion::l, disk_edgeuse::l2, disk_loopuse::l_p, disk_loop::lg_p, disk_faceuse::lu_hd, disk_shell::lu_hd, disk_loop::lu_p, disk_loopuse::lumate_p, disk_nmgregion::m_p, vertexuse::magic_p, edgeuse::magic_p, loopuse::magic_p, face::magic_p, loop_g::max_pt, shell_a::max_pt, nmgregion_a::max_pt, loop_g::min_pt, shell_a::min_pt, nmgregion_a::min_pt, vertexuse_a_plane::N, face_g_plane::N, NMG_CK_EDGE, NMG_CK_EDGE_G_CNURB, NMG_CK_EDGE_G_LSEG, NMG_CK_EDGEUSE, NMG_CK_FACE, NMG_CK_FACE_G_PLANE, NMG_CK_FACE_G_SNURB, NMG_CK_FACEUSE, NMG_CK_LOOP, NMG_CK_LOOP_G, NMG_CK_LOOPUSE, NMG_CK_MODEL, NMG_CK_REGION, NMG_CK_REGION_A, NMG_CK_SHELL, NMG_CK_SHELL_A, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, NMG_CK_VERTEXUSE_A_CNURB, NMG_CK_VERTEXUSE_A_EITHER, NMG_CK_VERTEXUSE_A_PLANE, NMG_KIND_EDGE, NMG_KIND_EDGE_G_CNURB, NMG_KIND_EDGE_G_LSEG, NMG_KIND_EDGEUSE, NMG_KIND_FACE, NMG_KIND_FACE_G_PLANE, NMG_KIND_FACE_G_SNURB, NMG_KIND_FACEUSE, NMG_KIND_LOOP, NMG_KIND_LOOP_G, NMG_KIND_LOOPUSE, NMG_KIND_MODEL, NMG_KIND_NMGREGION, NMG_KIND_NMGREGION_A, NMG_KIND_SHELL, NMG_KIND_SHELL_A, NMG_KIND_VERTEX, NMG_KIND_VERTEX_G, NMG_KIND_VERTEXUSE, NMG_KIND_VERTEXUSE_A_CNURB, NMG_KIND_VERTEXUSE_A_PLANE, edge_g_cnurb::order, face_g_snurb::order, edgeuse::orientation, loopuse::orientation, faceuse::orientation, vertexuse_a_cnurb::param, nmg_exp_counts::per_struct_index, edge_g_cnurb::pt_type, face_g_snurb::pt_type, PUTMAGIC, disk_model::r_hd, disk_shell::r_p, disk_nmgregion::ra_p, disk_edgeuse::radial_p, rt_nmg_export_fastf(), rt_nmg_reindex(), RT_NURB_EXTRACT_PT_TYPE, RT_NURB_PT_UV, disk_nmgregion::s_hd, disk_faceuse::s_p, face_g_snurb::s_size, disk_shell::sa_p, face_g_snurb::u, vertexuse::up, edgeuse::up, loopuse::up, face_g_snurb::v, disk_vertexuse::v_p, disk_vertex::vg_p, VMOVE, VSCALE, disk_vertex::vu_hd, disk_edgeuse::vu_p, and disk_shell::vu_p.

Here is the call graph for this function:

int rt_nmg_idisk genptr_t  op,
genptr_t  ip,
struct nmg_exp_counts ecnt,
int  index,
long int **  ptrs,
const fastf_t mat,
const unsigned char *  basep
 

R T _ N M G _ I D I S K

Import a given structure from disk to memory format.

Transform geometry by given matrix.

Definition at line 1399 of file g_nmg.c.

References vertexuse::a, bu_list::back, bn_rotate_bbox(), bn_rotate_plane(), bu_glong(), BU_LIST_NULL, bu_log(), edge_g_cnurb::c_size, vertex_g::coord, edge_g_cnurb::ctl_points, face_g_snurb::ctl_points, DISK_EDGE_G_CNURB_MAGIC, DISK_EDGE_G_LSEG_MAGIC, DISK_EDGE_MAGIC, DISK_EDGEUSE_MAGIC, DISK_FACE_G_PLANE_MAGIC, DISK_FACE_G_SNURB_MAGIC, DISK_FACE_MAGIC, DISK_FACEUSE_MAGIC, DISK_LOOP_G_MAGIC, DISK_LOOP_MAGIC, DISK_LOOPUSE_MAGIC, DISK_MODEL_MAGIC, DISK_REGION_A_MAGIC, DISK_REGION_MAGIC, DISK_SHELL_A_MAGIC, DISK_SHELL_MAGIC, DISK_VERTEX_G_MAGIC, DISK_VERTEX_MAGIC, DISK_VERTEXUSE_A_CNURB_MAGIC, DISK_VERTEXUSE_A_PLANE_MAGIC, DISK_VERTEXUSE_MAGIC, loopuse::down_hd, disk_loopuse::down_hd, edge_g_lseg::e_dir, edgeuse::e_p, disk_edgeuse::e_p, edge_g_lseg::e_pt, shell::eu_hd, disk_shell::eu_hd, edge_g_cnurb::eu_hd2, disk_edge_g_cnurb::eu_hd2, disk_edge_g_lseg::eu_hd2, edge_g_lseg::eu_hd2, edge::eu_p, disk_edge::eu_p, edgeuse::eumate_p, disk_edgeuse::eumate_p, face_g_snurb::f_hd, disk_face_g_snurb::f_hd, disk_face_g_plane::f_hd, face_g_plane::f_hd, faceuse::f_p, disk_faceuse::f_p, face::flip, bu_list::forw, shell::fu_hd, disk_shell::fu_hd, loopuse::fu_p, face::fu_p, disk_face::fu_p, faceuse::fumate_p, disk_faceuse::fumate_p, edgeuse::g, face::g, INDEX, INDEXL_HD, INDEXL_HD2, edge::is_real, edge_g_cnurb::k, knot_vector::k_size, nmg_exp_counts::kind, knot_vector::knots, disk_vertexuse::l, disk_edgeuse::l, disk_loopuse::l, disk_face::l, disk_faceuse::l, disk_shell::l, disk_nmgregion::l, edgeuse::l2, disk_edgeuse::l2, loopuse::l_p, disk_loopuse::l_p, disk_loop::lg_p, edgeuse::lseg_p, faceuse::lu_hd, disk_faceuse::lu_hd, shell::lu_hd, disk_shell::lu_hd, edgeuse::lu_p, loop::lu_p, disk_loop::lu_p, disk_loopuse::lumate_p, nmgregion::m_p, disk_nmgregion::m_p, vertexuse::magic_p, edgeuse::magic_p, loopuse::magic_p, face::magic_p, MAT4X3PNT, MAT4X3VEC, loop_g::max_pt, shell_a::max_pt, nmgregion_a::max_pt, loop_g::min_pt, shell_a::min_pt, nmgregion_a::min_pt, vertexuse_a_plane::N, face_g_plane::N, NMG_CK_EDGE, NMG_CK_EDGE_G_CNURB, NMG_CK_EDGE_G_EITHER, NMG_CK_EDGE_G_LSEG, NMG_CK_EDGEUSE, NMG_CK_FACE, NMG_CK_FACE_G_EITHER, NMG_CK_FACE_G_PLANE, NMG_CK_FACE_G_SNURB, NMG_CK_FACEUSE, NMG_CK_LOOP, NMG_CK_LOOP_G, NMG_CK_LOOPUSE, NMG_CK_MODEL, NMG_CK_REGION, NMG_CK_REGION_A, NMG_CK_SHELL, NMG_CK_SHELL_A, NMG_CK_VERTEX, NMG_CK_VERTEX_G, NMG_CK_VERTEXUSE, NMG_CK_VERTEXUSE_A_CNURB, NMG_CK_VERTEXUSE_A_EITHER, NMG_CK_VERTEXUSE_A_PLANE, NMG_KIND_EDGE, NMG_KIND_EDGE_G_CNURB, NMG_KIND_EDGE_G_LSEG, NMG_KIND_EDGEUSE, NMG_KIND_FACE, NMG_KIND_FACE_G_PLANE, NMG_KIND_FACE_G_SNURB, NMG_KIND_FACEUSE, NMG_KIND_LOOP, NMG_KIND_LOOP_G, NMG_KIND_LOOPUSE, NMG_KIND_MODEL, NMG_KIND_NMGREGION, NMG_KIND_NMGREGION_A, NMG_KIND_SHELL, NMG_KIND_SHELL_A, NMG_KIND_VERTEX, NMG_KIND_VERTEX_G, NMG_KIND_VERTEXUSE, NMG_KIND_VERTEXUSE_A_CNURB, NMG_KIND_VERTEXUSE_A_PLANE, ntohd(), NULL, edge_g_cnurb::order, face_g_snurb::order, edgeuse::orientation, loopuse::orientation, faceuse::orientation, vertexuse_a_cnurb::param, face::plane_p, edge_g_cnurb::pt_type, face_g_snurb::pt_type, model::r_hd, disk_model::r_hd, shell::r_p, disk_shell::r_p, disk_nmgregion::ra_p, edgeuse::radial_p, disk_edgeuse::radial_p, rt_bomb(), RT_CK_DISKMAGIC, rt_nmg_import_fastf(), RT_NURB_EXTRACT_PT_TYPE, RT_NURB_PT_UV, nmgregion::s_hd, disk_nmgregion::s_hd, edgeuse::s_p, loopuse::s_p, faceuse::s_p, disk_faceuse::s_p, face_g_snurb::s_size, disk_shell::sa_p, face_g_snurb::u, vertexuse::up, edgeuse::up, loopuse::up, face_g_snurb::v, vertexuse::v_p, disk_vertexuse::v_p, disk_vertex::vg_p, disk_vertex::vu_hd, vertex::vu_hd, edgeuse::vu_p, disk_edgeuse::vu_p, and disk_shell::vu_p.

Here is the call graph for this function:

struct model* rt_nmg_ialloc long int **  ptrs,
struct nmg_exp_counts ecnt,
int *  kind_counts
 

R T _ N M G _ I A L L O C

Allocate storage for all the in-memory NMG structures, in preparation for the importation operation, using the GET_xxx() macros, so that m->maxindex, etc, are all appropriately handled.

Definition at line 1794 of file g_nmg.c.

References BU_LIST_INIT, bu_log(), loopuse::down_hd, shell::eu_hd, edge_g_cnurb::eu_hd2, edge_g_lseg::eu_hd2, face_g_snurb::f_hd, face_g_plane::f_hd, shell::fu_hd, GET_EDGE, GET_EDGE_G_CNURB, GET_EDGE_G_LSEG, GET_EDGEUSE, GET_FACE, GET_FACE_G_PLANE, GET_FACE_G_SNURB, GET_FACEUSE, GET_LOOP, GET_LOOP_G, GET_LOOPUSE, GET_REGION, GET_REGION_A, GET_SHELL, GET_SHELL_A, GET_VERTEX, GET_VERTEX_G, GET_VERTEXUSE, GET_VERTEXUSE_A_CNURB, GET_VERTEXUSE_A_PLANE, vertexuse::l, edge_g_cnurb::l, edge_g_lseg::l, edgeuse::l, loopuse::l, face_g_snurb::l, face::l, faceuse::l, shell::l, nmgregion::l, edgeuse::l2, faceuse::lu_hd, shell::lu_hd, vertex_g::magic, vertex::magic, vertexuse_a_cnurb::magic, vertexuse_a_plane::magic, edge::magic, loop_g::magic, loop::magic, face_g_plane::magic, shell_a::magic, nmgregion_a::magic, bu_list::magic, NMG_EDGE_G_CNURB_MAGIC, NMG_EDGE_G_LSEG_MAGIC, NMG_EDGE_MAGIC, NMG_EDGEUSE2_MAGIC, NMG_EDGEUSE_MAGIC, NMG_FACE_G_PLANE_MAGIC, NMG_FACE_G_SNURB_MAGIC, NMG_FACE_MAGIC, NMG_FACEUSE_MAGIC, NMG_KIND_DOUBLE_ARRAY, NMG_KIND_EDGE, NMG_KIND_EDGE_G_CNURB, NMG_KIND_EDGE_G_LSEG, NMG_KIND_EDGEUSE, NMG_KIND_FACE, NMG_KIND_FACE_G_PLANE, NMG_KIND_FACE_G_SNURB, NMG_KIND_FACEUSE, NMG_KIND_LOOP, NMG_KIND_LOOP_G, NMG_KIND_LOOPUSE, NMG_KIND_MODEL, NMG_KIND_NMGREGION, NMG_KIND_NMGREGION_A, NMG_KIND_SHELL, NMG_KIND_SHELL_A, NMG_KIND_VERTEX, NMG_KIND_VERTEX_G, NMG_KIND_VERTEXUSE, NMG_KIND_VERTEXUSE_A_CNURB, NMG_KIND_VERTEXUSE_A_PLANE, NMG_LOOP_G_MAGIC, NMG_LOOP_MAGIC, NMG_LOOPUSE_MAGIC, nmg_mm(), NMG_N_KINDS, NMG_REGION_A_MAGIC, NMG_REGION_MAGIC, NMG_SHELL_A_MAGIC, NMG_SHELL_MAGIC, NMG_VERTEX_G_MAGIC, NMG_VERTEX_MAGIC, NMG_VERTEXUSE_A_CNURB_MAGIC, NMG_VERTEXUSE_A_PLANE_MAGIC, NMG_VERTEXUSE_MAGIC, nmg_exp_counts::per_struct_index, rt_bomb(), nmgregion::s_hd, and vertex::vu_hd.

Here is the call graph for this function:

void rt_nmg_i2alloc struct nmg_exp_counts ecnt,
unsigned char *  cp,
int *  kind_counts,
int  maxindex
 

R T _ N M G _ I 2 A L L O C

Find the locations of all the variable-sized fastf_t arrays in the input record. Record that position as a byte offset from the very front of the input record in ecnt[], indexed by subscript number.

No storage is allocated here, that will be done by rt_nmg_import_fastf() on the fly. A separate call to bu_malloc() will be used, so that nmg_keg(), etc., can kill each array as appropriate.

Definition at line 2014 of file g_nmg.c.

References NMG_KIND_DOUBLE_ARRAY, NMG_N_KINDS, and rt_nmg_disk_sizes.

int rt_nmg_import_internal struct rt_db_internal ip,
const struct bu_external ep,
register const fastf_t mat,
int  rebound,
const struct bn_tol tol
 

R T _ N M G _ I M P O R T _ I N T E R N A L

Import an NMG from the database format to the internal format. Apply modeling transformations as well.

Special subscripts are used in the disk file: -1 indicates a pointer to the rt_list structure which heads a linked list, and is not the first struct element. 0 indicates that a null pointer should be used.

Definition at line 2060 of file g_nmg.c.

References BN_CK_TOL, BU_CK_EXTERNAL, bu_glong(), bu_log(), DBID_NMG, DISK_MODEL_VERSION, bu_external::ext_buf, nmg_exp_counts::kind, record::nmg_rec::N_structs, record::nmg_rec::N_version, record::nmg, NMG_N_KINDS, and record::u_id.

Referenced by rt_nmg_import().

Here is the call graph for this function:

int rt_nmg_export_internal struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
int  compact
 

R T _ N M G _ E X P O R T _ I N T E R N A L

The name is added by the caller, in the usual place.

When the "compact" flag is set, bounding boxes from (at present) nmgregion_a shell_a loop_g are not converted for storage in the database. They should be re-generated at import time.

If the "compact" flag is not set, then the NMG model is saved, verbatim.

The overall layout of the on-disk NMG is like this:

+---------------------------+ | NMG header granule | | solid name | | # additional granules | | format version | | kind_count[] array | +---------------------------+ | | | | ~ N_count granules ~ ~ : ~ | : | | | +---------------------------+

In the additional granules, all structures of "kind" 0 (model) go first, followed by all structures of kind 1 (nmgregion), etc. As each structure is output, it is assigned a subscript number, starting with #1 for the model structure. All pointers are converted to the matching subscript numbers. An on-disk subscript of zero indicates a corresponding NULL pointer in memory. All integers are converted to network (Big-Endian) byte order. All floating point values are stored in network (Big-Endian IEEE) format.

Definition at line 2198 of file g_nmg.c.

References bu_calloc(), bzero, ID_NMG, rt_db_internal::idb_ptr, nmg_exp_counts::kind, model::maxindex, NMG_CK_MODEL, nmg_m_struct_count(), NMG_N_KINDS, and RT_CK_DB_INTERNAL.

Referenced by rt_nmg_export().

Here is the call graph for this function:

int rt_nmg_import struct rt_db_internal ip,
const struct bu_external ep,
register const fastf_t mat,
const struct db_i dbip
 

R T _ N M G _ I M P O R T

Import an NMG from the database format to the internal format. Apply modeling transformations as well.

Definition at line 2381 of file g_nmg.c.

References BN_TOL_MAGIC, BU_CK_EXTERNAL, bu_log(), DBID_NMG, bn_tol::dist, bn_tol::dist_sq, bu_external::ext_buf, rt_db_internal::idb_ptr, bn_tol::magic, NMG_CK_MODEL, nmg_vmodel(), bn_tol::para, bn_tol::perp, RT_G_DEBUG, rt_nmg_import_internal(), and record::u_id.

Here is the call graph for this function:

int rt_nmg_import5 struct rt_db_internal ip,
struct bu_external ep,
register const mat_t  mat,
const struct db_i dbip
 

R T _ N M G _ I M P O R T 5

Definition at line 2422 of file g_nmg.c.

References BN_TOL_MAGIC, BU_CK_EXTERNAL, bu_glong(), bu_log(), DISK_MODEL_VERSION, bn_tol::dist, bn_tol::dist_sq, bu_external::ext_buf, bn_tol::magic, bn_tol::para, bn_tol::perp, and SIZEOF_NETWORK_LONG.

Here is the call graph for this function:

int rt_nmg_export struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip
 

R T _ N M G _ E X P O R T

The name is added by the caller, in the usual place.

Definition at line 2519 of file g_nmg.c.

References ID_NMG, rt_db_internal::idb_ptr, NMG_CK_MODEL, nmg_vmodel(), RT_CK_DB_INTERNAL, and rt_nmg_export_internal().

Here is the call graph for this function:

int rt_nmg_export5 struct bu_external ep,
const struct rt_db_internal ip,
double  local2mm,
const struct db_i dbip
 

R T _ N M G _ E X P O R T 5

Definition at line 2539 of file g_nmg.c.

References bu_calloc(), bzero, ID_NMG, rt_db_internal::idb_ptr, model::maxindex, NMG_CK_MODEL, nmg_m_struct_count(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_nmg_describe struct bu_vls str,
const struct rt_db_internal ip,
int  verbose,
double  mm2local
 

R T _ N M G _ D E S C R I B E

Make human-readable formatted presentation of this solid. First line describes type of solid. Additional lines are indented one tab, and give parameter values.

Definition at line 2715 of file g_nmg.c.

References bu_free(), bu_vls_printf(), rt_db_internal::idb_ptr, model::maxindex, NMG_CK_MODEL, nmg_m_struct_count(), and nmg_vls_struct_counts().

Here is the call graph for this function:

void rt_nmg_ifree struct rt_db_internal ip  ) 
 

R T _ N M G _ I F R E E

Free the storage associated with the rt_db_internal version of this solid.

Definition at line 2749 of file g_nmg.c.

References GENPTR_NULL, rt_db_internal::idb_ptr, NMG_CK_MODEL, nmg_km(), and RT_CK_DB_INTERNAL.

Here is the call graph for this function:

int rt_nmg_tclget Tcl_Interp interp,
const struct rt_db_internal intern,
const char *  attr
 

Definition at line 2764 of file g_nmg.c.

References BU_LIST_FIRST, BU_LIST_FIRST_MAGIC, BU_LIST_FOR, BU_LIST_FOR_BACKWARDS, BU_LIST_NON_EMPTY, bu_ptbl_free(), BU_PTBL_GET, bu_ptbl_init(), BU_PTBL_LEN, bu_ptbl_locate(), bu_vls_free(), bu_vls_init(), bu_vls_printf(), bu_vls_strcat(), bu_vls_strcpy(), rt_db_internal::idb_ptr, interp, NMG_CK_MODEL, NMG_CK_VERTEX, nmg_vertex_tabulate(), NMG_VERTEXUSE_MAGIC, NULL, OT_SAME, TCL_ERROR, TCL_STATIC, and V3ARGS.

Here is the call graph for this function:

int rt_nmg_tcladjust Tcl_Interp interp,
struct rt_db_internal intern,
int  argc,
char **  argv,
struct resource resp
 

Definition at line 2905 of file g_nmg.c.

References rt_db_internal::idb_ptr, interp, NMG_CK_MODEL, NULL, RT_CK_DB_INTERNAL, Tcl_DecrRefCount, TCL_ERROR, TCL_OK, and TCL_STATIC.

void rt_nmg_make const struct rt_functab ftp,
struct rt_db_internal intern,
double  d
 

Definition at line 3061 of file g_nmg.c.

References DB5_MAJORTYPE_BRLCAD, ID_NMG, rt_db_internal::idb_major_type, rt_db_internal::idb_meth, rt_db_internal::idb_ptr, and nmg_mm().

Here is the call graph for this function:


Variable Documentation

const int rt_nmg_disk_sizes[NMG_N_KINDS]
 

Initial value:

 {
        sizeof(struct disk_model),              
        sizeof(struct disk_nmgregion),
        sizeof(struct disk_nmgregion_a),
        sizeof(struct disk_shell),
        sizeof(struct disk_shell_a),
        sizeof(struct disk_faceuse),
        sizeof(struct disk_face),
        sizeof(struct disk_face_g_plane),
        sizeof(struct disk_face_g_snurb),
        sizeof(struct disk_loopuse),
        sizeof(struct disk_loop),               
        sizeof(struct disk_loop_g),
        sizeof(struct disk_edgeuse),
        sizeof(struct disk_edge),
        sizeof(struct disk_edge_g_lseg),
        sizeof(struct disk_edge_g_cnurb),
        sizeof(struct disk_vertexuse),
        sizeof(struct disk_vertexuse_a_plane),
        sizeof(struct disk_vertexuse_a_cnurb),
        sizeof(struct disk_vertex),
        sizeof(struct disk_vertex_g),           
        0,
        0,
        0,
        0,
        0       
}

Definition at line 667 of file g_nmg.c.

Referenced by rt_nmg_i2alloc().

const char rt_nmg_kind_names[NMG_N_KINDS+2][18]
 

Initial value:

 {
        "model",                                
        "nmgregion",
        "nmgregion_a",
        "shell",
        "shell_a",
        "faceuse",
        "face",
        "face_g_plane",
        "face_g_snurb",
        "loopuse",
        "loop",                                 
        "loop_g",
        "edgeuse",
        "edge",
        "edge_g_lseg",
        "edge_g_cnurb",
        "vertexuse",
        "vertexuse_a_plane",
        "vertexuse_a_cnurb",
        "vertex",
        "vertex_g",                             
        "k21",
        "k22",
        "k23",
        "k24",
        "double_array",                         
        "k26-OFF_END",
        "k27-OFF_END"
}

Definition at line 695 of file g_nmg.c.


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