#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_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) |
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) |
model * | rt_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] |
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.
|
Definition at line 63 of file g_nmg.c. Referenced by rt_nmg_prep(), and rt_nmg_shot(). |
|
Definition at line 64 of file g_nmg.c. Referenced by rt_nmg_prep(), and rt_nmg_shot(). |
|
|
|
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(). |
|
|
|
Definition at line 431 of file g_nmg.c. Referenced by rt_nmg_reindex(). |
|
Definition at line 433 of file g_nmg.c. Referenced by rt_nmg_import5(), and rt_nmg_import_internal(). |
|
Definition at line 441 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 448 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 457 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 464 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 476 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 483 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 492 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 499 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 515 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 527 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 534 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 541 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 553 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 560 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 568 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 580 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 595 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 602 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 608 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 617 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 623 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
Definition at line 629 of file g_nmg.c. Referenced by rt_nmg_export_fastf(), and rt_nmg_import_fastf(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
Definition at line 661 of file g_nmg.c. Referenced by rt_nmg_i2alloc(), rt_nmg_ialloc(), and rt_nmg_import_fastf(). |
|
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(). |
|
Definition at line 1360 of file g_nmg.c. Referenced by rt_nmg_edisk(), and rt_nmg_idisk(). |
|
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(). |
|
Definition at line 1002 of file g_nmg.c. Referenced by rt_nmg_edisk(). |
|
|
|
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(). |
|
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(). |
|
|
|
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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. |
|
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: ![]() |
|
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 |
|
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: ![]() |
|
R T _ N M G _ C L A S S |
|
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: ![]() |
|
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: ![]() |
|
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
|
|
|
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. |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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: ![]() |
|
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. |
|
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: ![]() |
|
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(). |
|
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" } |