BRL-CAD
|
GED Database Format v4. More...
Go to the source code of this file.
Data Structures | |
struct | ident |
struct | solidrec |
struct | combination |
struct | member |
struct | material_rec |
struct | B_solid |
struct | b_surf |
struct | polyhead |
struct | polydata |
struct | ars_rec |
struct | ars_ext |
struct | strsol |
struct | arbn_rec |
struct | exported_pipe_pnt |
struct | pipewire_rec |
struct | particle_rec |
struct | extr_rec |
struct | sketch_rec |
struct | annot_rec |
struct | script_rec |
struct | cline_rec |
struct | bot_rec |
union | record |
Macros | |
#define | NAMESIZE 16 |
#define | NAMEMOVE(from, to) (void)strncpy(to, from, NAMESIZE) |
#define | DB_MINREC 128 |
#define | ID_NO_UNIT 0 /* unspecified */ |
#define | ID_MM_UNIT 1 /* millimeters (preferred) */ |
#define | ID_CM_UNIT 2 /* centimeters */ |
#define | ID_M_UNIT 3 /* meters */ |
#define | ID_IN_UNIT 4 /* inches */ |
#define | ID_FT_UNIT 5 /* feet */ |
#define | ID_UM_UNIT 6 /* micrometers */ |
#define | ID_KM_UNIT 7 /* kilometers */ |
#define | ID_YD_UNIT 8 /* yards */ |
#define | ID_MI_UNIT 9 /* miles */ |
#define | ID_VERSION "v4" /* Current Version */ |
#define | ID_BY_UNKNOWN 0 /* unknown */ |
#define | ID_BY_VAX 1 /* VAX (Little Endian) */ |
#define | ED_BY_IBM 2 /* IBM (Big Endian) */ |
#define | ID_FT_UNKNOWN 0 /* unknown */ |
#define | ID_FT_VAX 1 /* VAX */ |
#define | ID_FT_IBM 2 /* IBM */ |
#define | ID_FT_IEEE 3 /* IEEE */ |
#define | ID_FT_CRAY 4 /* Cray */ |
#define | RPP 1 /* axis-aligned rectangular parallelepiped */ |
#define | BOX 2 /* arbitrary rectangular parallelepiped */ |
#define | RAW 3 /* right-angle wedge */ |
#define | ARB4 4 /* tetrahedron */ |
#define | ARB5 5 /* pyramid */ |
#define | ARB6 6 /* extruded triangle */ |
#define | ARB7 7 /* weird 7-vertex shape */ |
#define | ARB8 8 /* hexahedron */ |
#define | ELL 9 /* ellipsoid */ |
#define | ELL1 10 /* another ellipsoid definition */ |
#define | SPH 11 /* sphere */ |
#define | RCC 12 /* right circular cylinder */ |
#define | REC 13 /* right elliptic cylinder */ |
#define | TRC 14 /* truncated regular cone */ |
#define | TEC 15 /* truncated elliptic cone */ |
#define | TOR 16 /* toroid */ |
#define | TGC 17 /* truncated general cone */ |
#define | GENTGC 18 /* supergeneralized TGC; internal form */ |
#define | GENELL 19 /* ready for drawing ELL: V, A, B, C */ |
#define | GENARB8 20 /* generalized ARB8: V, and 7 other vectors */ |
#define | ARS 21 /* HACK arbitrary triangular-surfaced polyhedron */ |
#define | ARSCONT 22 /* HACK extension record type for ARS solid */ |
#define | ELLG 23 /* comgeom version of GENELL ellipsoid */ |
#define | HALFSPACE 24 /* half-space */ |
#define | SPLINE 25 /* HACK and trouble */ |
#define | RPC 26 /* Right Parabolic Cylinder */ |
#define | RHC 27 /* Right Parabolic Cylinder */ |
#define | EPA 28 /* Elliptical Paraboloid */ |
#define | EHY 29 /* Elliptical Hyperboloid */ |
#define | ETO 30 /* Elliptical Torus */ |
#define | GRP 31 /* Grip pseudo solid */ |
#define | SUPERELL 32 /* Superquadratic Ellipsoid */ |
#define | HYP 33 /* Hyperboloid of one sheet */ |
#define | s_tgc_V s_values[0] |
#define | s_tgc_H s_values[3] |
#define | s_tgc_A s_values[6] |
#define | s_tgc_B s_values[9] |
#define | s_tgc_C s_values[12] |
#define | s_tgc_D s_values[15] |
#define | s_tor_V s_values[0] |
#define | s_tor_H s_values[3] |
#define | s_tor_A s_values[6] |
#define | s_tor_B s_values[9] |
#define | s_tor_C s_values[12] |
#define | s_tor_D s_values[15] |
#define | s_tor_E s_values[18] |
#define | s_tor_F s_values[21] |
#define | s_ell_V s_values[0] |
#define | s_ell_A s_values[3] |
#define | s_ell_B s_values[6] |
#define | s_ell_C s_values[9] |
#define | s_superell_V s_values[0] |
#define | s_superell_A s_values[3] |
#define | s_superell_B s_values[6] |
#define | s_superell_C s_values[9] |
#define | s_superell_n s_values[12] |
#define | s_superell_e s_values[13] |
#define | s_half_N s_values[0] |
#define | s_half_d s_values[3] |
#define | s_grip_C s_values[0] |
#define | s_grip_N s_values[3] |
#define | s_grip_m s_values[6] |
#define | DBV4_NON_REGION ' ' |
#define | DBV4_NON_REGION_NULL '\0' |
#define | DBV4_REGION 'R' |
#define | DBV4_REGION_FASTGEN_PLATE 'P' |
#define | DBV4_REGION_FASTGEN_VOLUME 'V' |
#define | DB_INH_LOWER 0 /* Lower nodes override */ |
#define | DB_INH_HIGHER 1 /* Higher nodes override */ |
#define | DB_SS_NGRAN 8 /* All STRSOL's have this many granules */ |
#define | DB_SS_LEN (DB_SS_NGRAN*DB_MINREC-2*NAMESIZE-2) |
#define | ID_IDENT 'I' |
#define | ID_SOLID 'S' |
#define | ID_COMB 'C' |
#define | ID_MEMB 'M' |
#define | ID_ARS_A 'A' |
#define | ID_ARS_B 'B' |
#define | ID_FREE 'F' /* Free record -- ignore */ |
#define | ID_P_HEAD 'P' /* Polygon header */ |
#define | ID_P_DATA 'Q' /* Polygon data record */ |
#define | ID_BSOLID 'b' /* B-spline solid. multiple surfs */ |
#define | ID_BSURF 'D' /* d_spline surface header */ |
#define | ID_COLORTAB 'm' /* Material "color table" record */ |
#define | DBID_STRSOL 's' /* String solid description */ |
#define | DBID_ARBN 'n' /* Convex polyhedron with N faces */ |
#define | DBID_PIPE 'w' /* pipe (wire) solid */ |
#define | DBID_PARTICLE 'p' /* a particle (lozenge) */ |
#define | DBID_NMG 'N' /* NMG solid */ |
#define | DBID_SKETCH 'd' /* 2D sketch */ |
#define | DBID_ANNOT 'a' /* 2D annotations */ |
#define | DBID_EXTR 'e' /* solid of extrusion */ |
#define | DBID_CLINE 'c' /* FASTGEN4 CLINE solid */ |
#define | DBID_BOT 't' /* Bag o' triangles */ |
#define | DBID_SCRIPT 'T' /* script */ |
#define | DB_RECORD_NULL ((union record *)0) |
Typedefs | |
typedef float | dbfloat_t |
Functions | |
DEPRECATED void | rt_fastf_float (fastf_t *ff, const dbfloat_t *fp, int n, int flip) |
DEPRECATED void | rt_mat_dbmat (fastf_t *ff, const dbfloat_t *dbp, int flip) |
DEPRECATED void | rt_dbmat_mat (dbfloat_t *dbp, const fastf_t *ff) |
GED Database Format v4.
All records are rounded up to have a fixed length; each such database record is also known as a "granule", and is the smallest unit of database storage.
Every granule can be identified by the first byte, which can be accessed by the u_id name. Note that the u_id field is not valid when writing the actual data for splines.
Each granule is read into a "union record", and is then processed based on the value of u_id. Each granule will have one of these formats: A Free record An ID record A SOLID record A COMBINATION record, followed by multiple MEMBER records An ARS ‘A’ (header) record, followed by multiple ARS ‘B’ (data) records A Polygon header record, followed by multiple Polygon data records A B-spline solid header record, followed by multiple B-spline surface records, followed by d_kv_size[0] floats, d_kv_size[1] floats, padded to d_nknots granules, followed by ctl_size[0]*ctl_size[1]*geom_type floats, padded to d_nctls granules.
The records are stored as binary records corresponding to PDP-11 and VAX C structs, so padding must be supplied explicitly for alignment.
For the time being, the representation of the floating point numbers in the database is machine-specific, requiring conversion to ASCII (via g2asc) and back to binary (via asc2g) when exchanging between machines of dissimilar types. In time, an external representation for floats might be implemented.
Definition in file db4.h.
#define GENARB8 20 /* generalized ARB8: V, and 7 other vectors */ |
#define ARS 21 /* HACK arbitrary triangular-surfaced polyhedron */ |
#define DB_SS_NGRAN 8 /* All STRSOL's have this many granules */ |
#define DB_SS_LEN (DB_SS_NGRAN*DB_MINREC-2*NAMESIZE-2) |