[brlcad-commits] SF.net SVN: brlcad:[59124] brlcad/trunk/include
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <tbr...@us...> - 2013-12-23 02:40:23
|
Revision: 59124 http://sourceforge.net/p/brlcad/code/59124 Author: tbrowder2 Date: 2013-12-23 02:40:20 +0000 (Mon, 23 Dec 2013) Log Message: ----------- updates to get BRL-CAD C source files compiled warning- and error-free with a C++ compiler: + move C child structs up to top level (no change to C scope but makes scope same in C++ so src/librt/cut.c will compile without error) + in rtgeom.h, struct rt_functab, increased size of two char arrays to make room for string-ending NULL for the current max length of the actual initialized strings being used successful debug build on Debian 7, 64-bit: no warnings or errors (except for the usual from libgiam, tcl, and step) successful 'make regress', 'make test', and 'make benchmark' Modified Paths: -------------- brlcad/trunk/include/db.h brlcad/trunk/include/raytrace.h brlcad/trunk/include/rtgeom.h Modified: brlcad/trunk/include/db.h =================================================================== --- brlcad/trunk/include/db.h 2013-12-23 02:27:57 UTC (rev 59123) +++ brlcad/trunk/include/db.h 2013-12-23 02:40:20 UTC (rev 59124) @@ -85,36 +85,10 @@ #define DB_MINREC 128 -union record { - char u_id; /* To differentiate record types */ -#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_MATERIAL 'm' /* Material description 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_EXTR 'e' /* solid of extrusion */ -#define DBID_CLINE 'c' /* FASTGEN4 CLINE solid */ -#define DBID_BOT 't' /* Bag o' triangles */ - - char u_size[DB_MINREC]; /* Minimum record size */ - - struct ident { - char i_id; /* ID_IDENT */ - char i_units; /* units */ +struct ident { + char i_id; /* ID_IDENT */ + char i_units; /* units */ /* Values of 0..5 are fixed for file compat with Release 2.3 through 4.5 */ #define ID_NO_UNIT 0 /* unspecified */ #define ID_MM_UNIT 1 /* millimeters (preferred) */ @@ -127,25 +101,25 @@ #define ID_KM_UNIT 7 /* kilometers */ #define ID_YD_UNIT 8 /* yards */ #define ID_MI_UNIT 9 /* miles */ - char i_version[6]; /* Version code of Database format */ + char i_version[6]; /* Version code of Database format */ #define ID_VERSION "v4" /* Current Version */ - char i_title[72]; /* Title or description */ - /* For the future */ - char i_byteorder; /* Byte ordering */ + char i_title[72]; /* Title or description */ + /* For the future */ + char i_byteorder; /* Byte ordering */ #define ID_BY_UNKNOWN 0 /* unknown */ #define ID_BY_VAX 1 /* VAX (Little Endian) */ #define ED_BY_IBM 2 /* IBM (Big Endian) */ - char i_floattype; /* Floating point type */ + char i_floattype; /* Floating point type */ #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 */ - } i; +}; /* struct ident */ - struct solidrec { - char s_id; /* ID_SOLID */ - char s_type; /* GED primitive type */ +struct solidrec { + char s_id; /* ID_SOLID */ + char s_type; /* GED primitive type */ /* also TOR 16 toroid */ #define GENTGC 18 /* supergeneralized TGC; internal form */ #define GENELL 19 /* ready for drawing ELL: V, A, B, C */ @@ -162,8 +136,8 @@ #define GRP 31 /* Grip pseudo solid */ #define SUPERELL 32 /* Superquadratic Ellipsoid */ #define HYP 33 /* Hyperboloid of one sheet */ - char s_name[NAMESIZE]; /* unique name */ - short s_cgtype; /* COMGEOM solid type */ + char s_name[NAMESIZE]; /* unique name */ + short s_cgtype; /* COMGEOM solid type */ #define RPP 1 /* axis-aligned rectangular parallelepiped */ #define BOX 2 /* arbitrary rectangular parallelepiped */ #define RAW 3 /* right-angle wedge */ @@ -182,7 +156,7 @@ #define TOR 16 /* toroid */ #define TGC 17 /* truncated general cone */ #define ELLG 23 /* comgeom version of GENELL ellipsoid */ - dbfloat_t s_values[24]; /* parameters */ + dbfloat_t s_values[24]; /* parameters */ #define s_tgc_V s_values[0] #define s_tgc_H s_values[3] #define s_tgc_A s_values[6] @@ -217,229 +191,293 @@ #define s_grip_C s_values[0] #define s_grip_N s_values[3] #define s_grip_m s_values[6] - } s; +}; /* struct solidrec */ - struct combination { - char c_id; /* ID_COMB */ - char c_flags; /* `R' if region, else ` ' */ +struct combination { + char c_id; /* ID_COMB */ + char c_flags; /* `R' if region, else ` ' */ #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' - char c_name[NAMESIZE]; /* unique name */ - short c_regionid; /* region ID code */ - short c_aircode; /* air space code */ - short c_pad1; /* was c_length, DEPRECATED: # of members */ - short c_pad2; /* was c_num, DEPRECATED */ - short c_material; /* (GIFT) material code */ - short c_los; /* equivalent LOS estimate */ - char c_override; /* non-0 ==> c_rgb is color */ - unsigned char c_rgb[3]; /* 0..255 color override */ - char c_matname[32]; /* Reference: Material name */ - char c_matparm[60]; /* String Material parms */ - char c_inherit; /* Inheritance property */ + char c_name[NAMESIZE]; /* unique name */ + short c_regionid; /* region ID code */ + short c_aircode; /* air space code */ + short c_pad1; /* was c_length, DEPRECATED: # of members */ + short c_pad2; /* was c_num, DEPRECATED */ + short c_material; /* (GIFT) material code */ + short c_los; /* equivalent LOS estimate */ + char c_override; /* non-0 ==> c_rgb is color */ + unsigned char c_rgb[3]; /* 0..255 color override */ + char c_matname[32]; /* Reference: Material name */ + char c_matparm[60]; /* String Material parms */ + char c_inherit; /* Inheritance property */ #define DB_INH_LOWER 0 /* Lower nodes override */ #define DB_INH_HIGHER 1 /* Higher nodes override */ - } c; - struct member { - char m_id; /* ID_MEMB */ - char m_relation; /* boolean operation */ +}; /* struct combination */ + +struct member { + char m_id; /* ID_MEMB */ + char m_relation; /* boolean operation */ #define INTERSECT '+' #define SUBTRACT '-' #define UNION 'u' - char m_brname[NAMESIZE]; /* DEPRECATED: name of this branch */ - char m_instname[NAMESIZE]; /* name of referred-to obj. */ - short m_pad1; - dbfloat_t m_mat[16]; /* homogeneous trans matrix */ - short m_pad2; /* was m_num, DEPRECATED: COMGEOM solid # ref */ - } M; + char m_brname[NAMESIZE]; /* DEPRECATED: name of this branch */ + char m_instname[NAMESIZE]; /* name of referred-to obj. */ + short m_pad1; + dbfloat_t m_mat[16]; /* homogeneous trans matrix */ + short m_pad2; /* was m_num, DEPRECATED: COMGEOM solid # ref */ +}; /* struct member */ - struct material_rec { /* whole record is DEPRECATED */ - char md_id; /* = ID_MATERIAL color override */ - char md_flags; /* UNUSED */ - short md_low; /* lower end of region IDs affected */ - short md_hi; /* upper end of region IDs affected */ - unsigned char md_r; - unsigned char md_g; /* color of these regions: 0..255 */ - unsigned char md_b; - char md_material[100]; /* UNUSED now */ - } md; +struct material_rec { /* whole record is DEPRECATED */ + char md_id; /* = ID_MATERIAL color override */ + char md_flags; /* UNUSED */ + short md_low; /* lower end of region IDs affected */ + short md_hi; /* upper end of region IDs affected */ + unsigned char md_r; + unsigned char md_g; /* color of these regions: 0..255 */ + unsigned char md_b; + char md_material[100]; /* UNUSED now */ +}; /* struct material_rec */ - struct B_solid { - char B_id; /* = ID_BSOLID */ - char B_pad; - char B_name[NAMESIZE]; - short B_nsurf; /* # of surfaces in this solid */ - dbfloat_t B_unused; /* UNUSED (was resolution of flatness) */ - } B; - struct b_surf { - char d_id; /* = ID_BSURF */ - short d_order[2]; /* order of u and v directions */ - short d_kv_size[2]; /* knot vector size (u and v) */ - short d_ctl_size[2]; /* control mesh size ( u and v) */ - short d_geom_type; /* geom type 3 or 4 */ - short d_nknots; /* # granules of knots */ - short d_nctls; /* # granules of ctls */ - } d; +struct B_solid { + char B_id; /* = ID_BSOLID */ + char B_pad; + char B_name[NAMESIZE]; + short B_nsurf; /* # of surfaces in this solid */ + dbfloat_t B_unused; /* UNUSED (was resolution of flatness) */ +}; /* struct B_solid */ + +struct b_surf { + char d_id; /* = ID_BSURF */ + short d_order[2]; /* order of u and v directions */ + short d_kv_size[2]; /* knot vector size (u and v) */ + short d_ctl_size[2]; /* control mesh size ( u and v) */ + short d_geom_type; /* geom type 3 or 4 */ + short d_nknots; /* # granules of knots */ + short d_nctls; /* # granules of ctls */ +}; /* struct b_surf */ + +struct polyhead { + char p_id; /* = POLY_HEAD */ + char p_pad1; + char p_name[NAMESIZE]; +}; /* struct polyhead */ + +struct polydata { + char q_id; /* = POLY_DATA */ + char q_count; /* # of vertices <= 5 */ + dbfloat_t q_verts[5][3]; /* Actual vertices for this polygon */ + dbfloat_t q_norms[5][3]; /* Normals at each vertex */ +}; /* struct polydata */ + +struct ars_rec { + char a_id; /* ID_ARS_A */ + char a_type; /* primitive type */ + char a_name[NAMESIZE]; /* unique name */ + short a_m; /* # of curves */ + short a_n; /* # of points per curve */ + short a_curlen; /* # of granules per curve */ + short a_totlen; /* # of granules for ARS */ + /* Remainder are unused, and exist for ?compatibility */ + short a_pad; + dbfloat_t a_xmax; /* max x coordinate */ + dbfloat_t a_xmin; /* min x coordinate */ + dbfloat_t a_ymax; /* max y coordinate */ + dbfloat_t a_ymin; /* min y coordinate */ + dbfloat_t a_zmax; /* max z coordinate */ + dbfloat_t a_zmin; /* min z coordinate */ +}; /* struct ars_rec */ + +struct ars_ext { + char b_id; /* ID_ARS_B */ + char b_type; /* primitive type */ + short b_n; /* current curve # */ + short b_ngranule; /* curr. granule for curve */ + short b_pad; + dbfloat_t b_values[8*3]; /* vectors */ +}; /* struct ars_ext */ + +struct strsol { + char ss_id; /* ID_STRSOL */ + char ss_pad; + char ss_name[NAMESIZE]; /* solid name */ +#define DB_SS_NGRAN 8 /* All STRSOL's have this many granules */ +#define DB_SS_LEN (DB_SS_NGRAN*DB_MINREC-2*NAMESIZE-2) + char ss_keyword[NAMESIZE]; /* solid keyword */ + char ss_args[4]; /* DB_SS_LEN bytes of str args */ +}; /* struct strsol */ + +struct arbn_rec { + char n_id; /* DBID_ARBN */ + char n_pad; + char n_name[NAMESIZE]; + unsigned char n_neqn[4]; /* # equations which follow */ + unsigned char n_grans[4]; /* # eqn granules to follow */ + /* Note that eqn granules are in "network" byte order */ +}; /* struct arbn_rec */ + +struct exported_pipept { + unsigned char epp_coord[8*3]; + unsigned char epp_bendradius[8]; + unsigned char epp_id[8]; + unsigned char epp_od[8]; +}; /* exported_pipept */ + +struct pipewire_rec { + char pwr_id; /* DBID_PIPE */ + char pwr_pad; + char pwr_name[NAMESIZE]; + unsigned char pwr_pt_count[4]; /* number of points in this pipe solid */ + unsigned char pwr_count[4]; /* # additional granules */ + struct exported_pipept pwr_data[1]; /* mach indep segments */ +}; /* struct pipewire_rec */ + +struct particle_rec { + char p_id; /* DBID_PARTICLE */ + char p_pad; + char p_name[NAMESIZE]; + unsigned char p_v[8*3]; /* vertex (mach indep fmt) */ + unsigned char p_h[8*3]; /* height vector */ + unsigned char p_vrad[8]; /* radius at vertex */ + unsigned char p_hrad[8]; /* radius at end of height */ +}; /* struct particle_rec */ + +struct nmg_rec { + char N_id; /* DBID_NMG */ + char N_version; /* Version indicator */ + char N_name[NAMESIZE]; + char N_pad2[2]; /* neatness */ + unsigned char N_count[4]; /* # additional granules */ + unsigned char N_structs[26*4];/* # of structs needed */ +}; /* struct nmg_rec */ + +struct extr_rec { + char ex_id; /* DBID_EXTR */ + char ex_pad; + char ex_name[NAMESIZE]; + unsigned char ex_V[8*3]; /* Vertex */ + unsigned char ex_h[8*3]; /* extrusion vector */ + unsigned char ex_uvec[8*3]; /* vector in U parameter direction */ + unsigned char ex_vvec[8*3]; /* vector in V parameter direction */ + unsigned char ex_key[4]; /* keypoint index */ + unsigned char ex_count[4]; /* number of additional granules + * (for now, this will always be 1 ) */ +}; /* struct extr_rec */ + +struct sketch_rec { + char skt_id; /* DBID_SKETCH */ + char skt_pad; + char skt_name[NAMESIZE]; + unsigned char skt_V[8*3]; /* vertex */ + unsigned char skt_uvec[8*3]; /* vector in U parameter direction */ + unsigned char skt_vvec[8*3]; /* vector in V parameter direction */ + unsigned char skt_vert_count[4]; /* number of vertices in sketch */ + unsigned char skt_seg_count[4]; /* number of segments in sketch */ + unsigned char skt_count[4]; /* number of additional granules */ +}; /* struct sketch_rec */ + +struct cline_rec { + char cli_id; /* DBID_CLINE */ + char cli_pad; + char cli_name[NAMESIZE]; + unsigned char cli_V[8*3]; /* vertex */ + unsigned char cli_h[8*3]; /* height vector */ + unsigned char cli_radius[8]; /* radius */ + unsigned char cli_thick[8]; /* plate thickness (0 means volume mode) */ +}; /* struct cline_rec */ + +struct bot_rec { + char bot_id; + char bot_pad; + char bot_name[NAMESIZE]; + unsigned char bot_nrec[4]; /* number of additional records required */ + unsigned char bot_orientation; /* unoriented, ccw, or cw */ + unsigned char bot_mode; /* surface or volume */ + unsigned char bot_err_mode; + unsigned char bot_num_verts[4]; /* number of vertices */ + unsigned char bot_num_triangles[4]; /* number of triangles */ + unsigned char bot_data[1]; /* the start of the data: + * num_verts*3*8 for the vertex floats + * num_triangles*3*4 for the triangle ints + * if mode is RT_BOT_PLATE, then additional data is: + * num_triangles*8 for the face thicknesses + * followed by a null terminated hex digit string "face_mode" (bit vector) */ +}; /* struct bot_rec */ + +union record { + + char u_id; /* To differentiate record types */ +#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_MATERIAL 'm' /* Material description 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_EXTR 'e' /* solid of extrusion */ +#define DBID_CLINE 'c' /* FASTGEN4 CLINE solid */ +#define DBID_BOT 't' /* Bag o' triangles */ + + char u_size[DB_MINREC]; /* Minimum record size */ + + struct ident i; + struct solidrec s; + struct combination c; + struct member M; + struct material_rec md; + struct B_solid B; + struct b_surf d; /* * The b_surf record is followed by * d_nknots granules of knot vectors (first u, then v), * and then by d_nctls granules of control mesh information. * Note that neither of these have an ID field! */ - - struct polyhead { - char p_id; /* = POLY_HEAD */ - char p_pad1; - char p_name[NAMESIZE]; - } p; - struct polydata { - char q_id; /* = POLY_DATA */ - char q_count; /* # of vertices <= 5 */ - dbfloat_t q_verts[5][3]; /* Actual vertices for this polygon */ - dbfloat_t q_norms[5][3]; /* Normals at each vertex */ - } q; - - struct ars_rec { - char a_id; /* ID_ARS_A */ - char a_type; /* primitive type */ - char a_name[NAMESIZE]; /* unique name */ - short a_m; /* # of curves */ - short a_n; /* # of points per curve */ - short a_curlen; /* # of granules per curve */ - short a_totlen; /* # of granules for ARS */ - /* Remainder are unused, and exist for ?compatibility */ - short a_pad; - dbfloat_t a_xmax; /* max x coordinate */ - dbfloat_t a_xmin; /* min x coordinate */ - dbfloat_t a_ymax; /* max y coordinate */ - dbfloat_t a_ymin; /* min y coordinate */ - dbfloat_t a_zmax; /* max z coordinate */ - dbfloat_t a_zmin; /* min z coordinate */ - } a; - struct ars_ext { - char b_id; /* ID_ARS_B */ - char b_type; /* primitive type */ - short b_n; /* current curve # */ - short b_ngranule; /* curr. granule for curve */ - short b_pad; - dbfloat_t b_values[8*3]; /* vectors */ - } b; + struct polyhead p; + struct polydata q; + struct ars_rec a; + struct ars_ext b; /* * All records below here are in machine-independent format. */ - struct strsol { - char ss_id; /* ID_STRSOL */ - char ss_pad; - char ss_name[NAMESIZE]; /* solid name */ -#define DB_SS_NGRAN 8 /* All STRSOL's have this many granules */ -#define DB_SS_LEN (DB_SS_NGRAN*DB_MINREC-2*NAMESIZE-2) - char ss_keyword[NAMESIZE]; /* solid keyword */ - char ss_args[4]; /* DB_SS_LEN bytes of str args */ - } ss; - struct arbn_rec { - char n_id; /* DBID_ARBN */ - char n_pad; - char n_name[NAMESIZE]; - unsigned char n_neqn[4]; /* # equations which follow */ - unsigned char n_grans[4]; /* # eqn granules to follow */ - /* Note that eqn granules are in "network" byte order */ - } n; + struct strsol ss; + struct arbn_rec n; /* new pipe solid */ - struct pipewire_rec { - char pwr_id; /* DBID_PIPE */ - char pwr_pad; - char pwr_name[NAMESIZE]; - unsigned char pwr_pt_count[4]; /* number of points in this pipe solid */ - unsigned char pwr_count[4]; /* # additional granules */ - struct exported_pipept { - unsigned char epp_coord[8*3]; - unsigned char epp_bendradius[8]; - unsigned char epp_id[8]; - unsigned char epp_od[8]; - } pwr_data[1]; /* mach indep segments */ - } pwr; - struct particle_rec { - char p_id; /* DBID_PARTICLE */ - char p_pad; - char p_name[NAMESIZE]; - unsigned char p_v[8*3]; /* vertex (mach indep fmt) */ - unsigned char p_h[8*3]; /* height vector */ - unsigned char p_vrad[8]; /* radius at vertex */ - unsigned char p_hrad[8]; /* radius at end of height */ - } part; + struct pipewire_rec pwr; + struct particle_rec part; + /* Version 0 is Release 4.0 to 4.2, Version 1 is Release 4.4 */ - struct nmg_rec { - char N_id; /* DBID_NMG */ - char N_version; /* Version indicator */ - char N_name[NAMESIZE]; - char N_pad2[2]; /* neatness */ - unsigned char N_count[4]; /* # additional granules */ - unsigned char N_structs[26*4];/* # of structs needed */ - } nmg; + struct nmg_rec nmg; /* Solid of extrusion */ - struct extr_rec { - char ex_id; /* DBID_EXTR */ - char ex_pad; - char ex_name[NAMESIZE]; - unsigned char ex_V[8*3]; /* Vertex */ - unsigned char ex_h[8*3]; /* extrusion vector */ - unsigned char ex_uvec[8*3]; /* vector in U parameter direction */ - unsigned char ex_vvec[8*3]; /* vector in V parameter direction */ - unsigned char ex_key[4]; /* keypoint index */ - unsigned char ex_count[4]; /* number of additional granules - * (for now, this will always be 1 ) */ - } extr; + struct extr_rec extr; /* sketch */ - struct sketch_rec { - char skt_id; /* DBID_SKETCH */ - char skt_pad; - char skt_name[NAMESIZE]; - unsigned char skt_V[8*3]; /* vertex */ - unsigned char skt_uvec[8*3]; /* vector in U parameter direction */ - unsigned char skt_vvec[8*3]; /* vector in V parameter direction */ - unsigned char skt_vert_count[4]; /* number of vertices in sketch */ - unsigned char skt_seg_count[4]; /* number of segments in sketch */ - unsigned char skt_count[4]; /* number of additional granules */ - } skt; + struct sketch_rec skt; /* FASTGEN4 CLINE element */ - struct cline_rec { - char cli_id; /* DBID_CLINE */ - char cli_pad; - char cli_name[NAMESIZE]; - unsigned char cli_V[8*3]; /* vertex */ - unsigned char cli_h[8*3]; /* height vector */ - unsigned char cli_radius[8]; /* radius */ - unsigned char cli_thick[8]; /* plate thickness (0 means volume mode) */ - } cli; + struct cline_rec cli; /* Bag o' triangles * The vertices are stored in an array * The faces are arrays of three ints each indexing into the array of vertices */ - struct bot_rec { - char bot_id; - char bot_pad; - char bot_name[NAMESIZE]; - unsigned char bot_nrec[4]; /* number of additional records required */ - unsigned char bot_orientation; /* unoriented, ccw, or cw */ - unsigned char bot_mode; /* surface or volume */ - unsigned char bot_err_mode; - unsigned char bot_num_verts[4]; /* number of vertices */ - unsigned char bot_num_triangles[4]; /* number of triangles */ - unsigned char bot_data[1]; /* the start of the data: - * num_verts*3*8 for the vertex floats - * num_triangles*3*4 for the triangle ints - * if mode is RT_BOT_PLATE, then additional data is: - * num_triangles*8 for the face thicknesses - * followed by a null terminated hex digit string "face_mode" (bit vector) */ - } bot; + struct bot_rec bot; -}; +}; /* union record */ #define DB_RECORD_NULL ((union record *)0) Modified: brlcad/trunk/include/raytrace.h =================================================================== --- brlcad/trunk/include/raytrace.h 2013-12-23 02:27:57 UTC (rev 59123) +++ brlcad/trunk/include/raytrace.h 2013-12-23 02:40:20 UTC (rev 59124) @@ -722,7 +722,7 @@ /** * C U T * - * Structure for space subdivision. + * Structures for space subdivision. * * cut_type is an integer for efficiency of access in rt_shootray() on * non-word addressing machines. @@ -730,42 +730,50 @@ * If a solid has 'pieces', it will be listed either in bn_list * (initially), or in bn_piecelist, but not both. */ -union cutter { +struct cutnode { + int cn_type; + int cn_axis; /**< @brief 0, 1, 2 = cut along X, Y, Z */ + fastf_t cn_point; /**< @brief cut through axis==point */ + union cutter * cn_l; /**< @brief val < point */ + union cutter * cn_r; /**< @brief val >= point */ +}; + +struct boxnode { + int bn_type; + fastf_t bn_min[3]; + fastf_t bn_max[3]; + struct soltab **bn_list; /**< @brief bn_list[bn_len] */ + size_t bn_len; /**< @brief # of solids in list */ + size_t bn_maxlen; /**< @brief # of ptrs allocated to list */ + struct rt_piecelist *bn_piecelist; /**< @brief [] solids with pieces */ + size_t bn_piecelen; /**< @brief # of piecelists used */ + size_t bn_maxpiecelen; /**< @brief # of piecelists allocated */ +}; + +struct nu_axis { + fastf_t nu_spos; /**< @brief cell start position */ + fastf_t nu_epos; /**< @brief cell end position */ + fastf_t nu_width; /**< @brief voxel size (end - start) */ +}; + +struct nugridnode { + int nu_type; + struct nu_axis *nu_axis[3]; + int nu_cells_per_axis[3]; /**< @brief number of slabs */ + int nu_stepsize[3]; /**< @brief number of cells to jump for one step in each axis */ + union cutter *nu_grid; /**< @brief 3-D array of boxnodes */ +}; + #define CUT_CUTNODE 1 #define CUT_BOXNODE 2 #define CUT_NUGRIDNODE 3 #define CUT_MAXIMUM 3 +union cutter { int cut_type; - union cutter *cut_forw; /**< @brief Freelist forward link */ - struct cutnode { - int cn_type; - int cn_axis; /**< @brief 0, 1, 2 = cut along X, Y, Z */ - fastf_t cn_point; /**< @brief cut through axis==point */ - union cutter * cn_l; /**< @brief val < point */ - union cutter * cn_r; /**< @brief val >= point */ - } cn; - struct boxnode { - int bn_type; - fastf_t bn_min[3]; - fastf_t bn_max[3]; - struct soltab **bn_list; /**< @brief bn_list[bn_len] */ - size_t bn_len; /**< @brief # of solids in list */ - size_t bn_maxlen; /**< @brief # of ptrs allocated to list */ - struct rt_piecelist *bn_piecelist; /**< @brief [] solids with pieces */ - size_t bn_piecelen; /**< @brief # of piecelists used */ - size_t bn_maxpiecelen; /**< @brief # of piecelists allocated */ - } bn; - struct nugridnode { - int nu_type; - struct nu_axis { - fastf_t nu_spos; /**< @brief cell start position */ - fastf_t nu_epos; /**< @brief cell end position */ - fastf_t nu_width; /**< @brief voxel size (end - start) */ - } *nu_axis[3]; - int nu_cells_per_axis[3]; /**< @brief number of slabs */ - int nu_stepsize[3]; /**< @brief number of cells to jump for one step in each axis */ - union cutter *nu_grid; /**< @brief 3-D array of boxnodes */ - } nugn; + union cutter *cut_forw; /**< @brief Freelist forward link */ + struct cutnode cn; + struct boxnode bn; + struct nugridnode nugn; }; @@ -2143,8 +2151,9 @@ */ struct rt_functab { uint32_t magic; - char ft_name[16]; - char ft_label[8]; + char ft_name[17]; /* current longest name is 16 chars, need one element for terminating NULL */ + char ft_label[9]; /* current longest label is 8 chars, need one element for terminating NULL */ + int ft_use_rpp; int (*ft_prep)(struct soltab *stp, struct rt_db_internal *ip, @@ -2175,6 +2184,7 @@ struct soltab *stp); int (*ft_classify)(const struct soltab * /*stp*/, const vect_t /*min*/, const vect_t /*max*/, const struct bn_tol * /*tol*/); void (*ft_free)(struct soltab * /*stp*/); + int (*ft_plot)(struct bu_list * /*vhead*/, struct rt_db_internal * /*ip*/, const struct rt_tess_tol * /*ttol*/, Modified: brlcad/trunk/include/rtgeom.h =================================================================== --- brlcad/trunk/include/rtgeom.h 2013-12-23 02:27:57 UTC (rev 59123) +++ brlcad/trunk/include/rtgeom.h 2013-12-23 02:40:20 UTC (rev 59124) @@ -194,14 +194,15 @@ /** * ID_POLY */ +struct rt_pg_face_internal { + size_t npts; /**< @brief number of points for this polygon */ + fastf_t *verts; /**< @brief has 3*npts elements */ + fastf_t *norms; /**< @brief has 3*npts elements */ +}; /**< @brief has npoly elements */ struct rt_pg_internal { uint32_t magic; size_t npoly; - struct rt_pg_face_internal { - size_t npts; /**< @brief number of points for this polygon */ - fastf_t *verts; /**< @brief has 3*npts elements */ - fastf_t *norms; /**< @brief has 3*npts elements */ - } *poly; /**< @brief has npoly elements */ + struct rt_pg_face_internal *poly; /**< @brief has npoly elements */ /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */ size_t max_npts; /**< @brief maximum value of npts in poly[] */ }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |