00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #ifndef SEEN_BU_H
00058 # include "bu.h"
00059 #endif
00060
00061 #ifndef SEEN_BN_H
00062 # include "bn.h"
00063 #endif
00064
00065 #ifndef RAYTRACE_H
00066 # include "raytrace.h"
00067 #endif
00068
00069 #ifndef SEEN_RTGEOM_H
00070 # include "rtgeom.h"
00071 #endif
00072
00073 #ifndef WDB_H
00074 #define WDB_H seen
00075
00076 __BEGIN_DECLS
00077
00078 #ifndef WDB_EXPORT
00079 # if defined(_WIN32) && !defined(__CYGWIN__) && defined(BRLCAD_DLL)
00080 # ifdef WDB_EXPORT_DLL
00081 # define WDB_EXPORT __declspec(dllexport)
00082 # else
00083 # define WDB_EXPORT __declspec(dllimport)
00084 # endif
00085 # else
00086 # define WDB_EXPORT
00087 # endif
00088 #endif
00089
00090
00091
00092
00093
00094
00095
00096 #if __STDC__ || USE_PROTOTYPES
00097 # define WDB_EXTERN(type_and_name,args) extern type_and_name args
00098 # define WDB_ARGS(args) args
00099 #else
00100 # define WDB_EXTERN(type_and_name,args) extern type_and_name()
00101 # define WDB_ARGS(args) ()
00102 #endif
00103
00104
00105
00106
00107 struct wmember {
00108 struct bu_list l;
00109 int wm_op;
00110 mat_t wm_mat;
00111 char *wm_name;
00112 };
00113 #define WMEMBER_NULL ((struct wmember *)0)
00114 #define WMEMBER_MAGIC 0x43128912
00115 #define WDB_CK_WMEMBER(_p) BU_CKMAG(_p, WMEMBER_MAGIC, "wmember" );
00116
00117
00118
00119
00120
00121
00122 struct wdb_pipept {
00123 struct bu_list l;
00124 point_t pp_coord;
00125 fastf_t pp_id;
00126 fastf_t pp_od;
00127 fastf_t pp_bendradius;
00128 };
00129
00130 #define WDB_PIPESEG_NULL ((struct wdb_pipeseg *)0)
00131 #define WDB_PIPESEG_MAGIC 0x9723ffef
00132
00133 struct wdb_metaballpt {
00134 struct bu_list l;
00135 point_t coord;
00136 fastf_t fldstr;
00137 };
00138 #define WDB_METABALLPT_NULL ((struct wdb_metaballpt *)0)
00139 #define WDB_METABALLPT_MAGIC 0x6D627074
00140
00141
00142 WDB_EXPORT WDB_EXTERN(int mk_id, (struct rt_wdb *fp, const char *title) );
00143 WDB_EXPORT WDB_EXTERN(int mk_id_units, (struct rt_wdb *fp, const char *title, const char *units) );
00144 WDB_EXPORT int mk_id_editunits(
00145 struct rt_wdb *fp,
00146 const char *title,
00147 double local2mm );
00148
00149
00150
00151
00152
00153 WDB_EXPORT WDB_EXTERN(int mk_half, (struct rt_wdb *fp, const char *name, const vect_t norm, double d) );
00154 WDB_EXPORT int mk_grip(
00155 struct rt_wdb *wdbp,
00156 const char *name,
00157 const point_t center,
00158 const vect_t normal,
00159 const fastf_t magnitude );
00160 WDB_EXPORT WDB_EXTERN(int mk_rpp, (struct rt_wdb *fp, const char *name, const point_t min,
00161 const point_t max) );
00162 WDB_EXPORT WDB_EXTERN(int mk_wedge, (struct rt_wdb *fp, const char *name, const point_t vert,
00163 const vect_t xdirv, const vect_t zdirv,
00164 fastf_t xlen, fastf_t ylen, fastf_t zlen,
00165 fastf_t x_top_len) );
00166 WDB_EXPORT WDB_EXTERN(int mk_arb4, (struct rt_wdb *fp, const char *name, const fastf_t *pts4) );
00167 WDB_EXPORT WDB_EXTERN(int mk_arb8, (struct rt_wdb *fp, const char *name, const fastf_t *pts8) );
00168 WDB_EXPORT WDB_EXTERN(int mk_sph, (struct rt_wdb *fp, const char *name, const point_t center,
00169 fastf_t radius) );
00170 WDB_EXPORT WDB_EXTERN(int mk_ell, (struct rt_wdb *fp, const char *name, const point_t center,
00171 const vect_t a, const vect_t b, const vect_t c) );
00172 WDB_EXPORT WDB_EXTERN(int mk_tor, (struct rt_wdb *fp, const char *name, const point_t center,
00173 const vect_t inorm, double r1, double r2) );
00174 WDB_EXPORT WDB_EXTERN(int mk_rcc, (struct rt_wdb *fp, const char *name, const point_t base,
00175 const vect_t height, fastf_t radius) );
00176 WDB_EXPORT WDB_EXTERN(int mk_tgc, (struct rt_wdb *fp, const char *name, const point_t base,
00177 const vect_t height, const vect_t a, const vect_t b,
00178 const vect_t c, const vect_t d) );
00179 WDB_EXPORT WDB_EXTERN(int mk_cone, (struct rt_wdb *fp, const char *name, const point_t base,
00180 const vect_t dirv, fastf_t height, fastf_t rad1,
00181 fastf_t rad2) );
00182 #define mk_trc(wrong) +++error_obsolete_libwdb_routine+++
00183 WDB_EXPORT WDB_EXTERN(int mk_trc_h, (struct rt_wdb *fp, const char *name, const point_t base,
00184 const vect_t height, fastf_t radbase, fastf_t radtop) );
00185 WDB_EXPORT WDB_EXTERN(int mk_trc_top, (struct rt_wdb *fp, const char *name, const point_t ibase,
00186 const point_t itop, fastf_t radbase, fastf_t radtop) );
00187 WDB_EXPORT int mk_rpc(
00188 struct rt_wdb *wdbp,
00189 const char *name,
00190 const point_t vert,
00191 const vect_t height,
00192 const vect_t breadth,
00193 double half_w );
00194 WDB_EXPORT int mk_rhc(
00195 struct rt_wdb *wdbp,
00196 const char *name,
00197 const point_t vert,
00198 const vect_t height,
00199 const vect_t breadth,
00200 fastf_t half_w,
00201 fastf_t asymp );
00202 WDB_EXPORT int mk_epa(
00203 struct rt_wdb *wdbp,
00204 const char *name,
00205 const point_t vert,
00206 const vect_t height,
00207 const vect_t breadth,
00208 fastf_t r1,
00209 fastf_t r2 );
00210 WDB_EXPORT int mk_ehy(
00211 struct rt_wdb *wdbp,
00212 const char *name,
00213 const point_t vert,
00214 const vect_t height,
00215 const vect_t breadth,
00216 fastf_t r1,
00217 fastf_t r2,
00218 fastf_t c );
00219 WDB_EXPORT int mk_eto(
00220 struct rt_wdb *wdbp,
00221 const char *name,
00222 const point_t vert,
00223 const vect_t norm,
00224 const vect_t smajor,
00225 fastf_t rrot,
00226 fastf_t sminor );
00227
00228 WDB_EXPORT WDB_EXTERN(int mk_arbn, (struct rt_wdb *fp, const char *name, int neqn, plane_t eqn[]) );
00229 WDB_EXPORT WDB_EXTERN(int mk_ars, (struct rt_wdb *fp, const char *name, int ncurves, int pts_per_curve,
00230 fastf_t *curves[]) );
00231
00232 typedef enum {
00233 WDB_BINUNIF_FLOAT,
00234 WDB_BINUNIF_DOUBLE,
00235 WDB_BINUNIF_CHAR,
00236 WDB_BINUNIF_UCHAR,
00237 WDB_BINUNIF_SHORT,
00238 WDB_BINUNIF_USHORT,
00239 WDB_BINUNIF_INT,
00240 WDB_BINUNIF_UINT,
00241 WDB_BINUNIF_LONG,
00242 WDB_BINUNIF_ULONG,
00243 WDB_BINUNIF_LONGLONG,
00244 WDB_BINUNIF_ULONGLONG,
00245 WDB_BINUNIF_INT8,
00246 WDB_BINUNIF_UINT8,
00247 WDB_BINUNIF_INT16,
00248 WDB_BINUNIF_UINT16,
00249 WDB_BINUNIF_INT32,
00250 WDB_BINUNIF_UINT32,
00251 WDB_BINUNIF_INT64,
00252 WDB_BINUNIF_UINT64,
00253 WDB_BINUNIF_FILE_FLOAT,
00254 WDB_BINUNIF_FILE_DOUBLE,
00255 WDB_BINUNIF_FILE_CHAR,
00256 WDB_BINUNIF_FILE_UCHAR,
00257 WDB_BINUNIF_FILE_SHORT,
00258 WDB_BINUNIF_FILE_USHORT,
00259 WDB_BINUNIF_FILE_INT,
00260 WDB_BINUNIF_FILE_UINT,
00261 WDB_BINUNIF_FILE_LONG,
00262 WDB_BINUNIF_FILE_ULONG,
00263 WDB_BINUNIF_FILE_LONGLONG,
00264 WDB_BINUNIF_FILE_ULONGLONG,
00265 WDB_BINUNIF_FILE_INT8,
00266 WDB_BINUNIF_FILE_UINT8,
00267 WDB_BINUNIF_FILE_INT16,
00268 WDB_BINUNIF_FILE_UINT16,
00269 WDB_BINUNIF_FILE_INT32,
00270 WDB_BINUNIF_FILE_UINT32,
00271 WDB_BINUNIF_FILE_INT64,
00272 WDB_BINUNIF_FILE_UINT64
00273 } wdb_binunif;
00274 WDB_EXPORT WDB_EXTERN(int mk_binunif, (struct rt_wdb *fp, const char *name, const genptr_t data, wdb_binunif data_type, long count) );
00275
00276 #define mk_bsolid(fp,name,nsurf,res) +++error_obsolete_libwdb_routine+++
00277 #define mk_bsurf(fp,srf) +++error_obsolete_libwdb_routine+++
00278
00279
00280 WDB_EXPORT int
00281 mk_bot(
00282 struct rt_wdb *fp,
00283 const char *name,
00284 unsigned char mode,
00285 unsigned char orientation,
00286 unsigned char error_mode,
00287 int num_vertices,
00288 int num_faces,
00289 fastf_t *vertices,
00290 int *faces,
00291 fastf_t *thickness,
00292
00293
00294 struct bu_bitv *face_mode );
00295
00296
00297 WDB_EXPORT int
00298 mk_bot_w_normals(
00299 struct rt_wdb *fp,
00300 const char *name,
00301 unsigned char mode,
00302 unsigned char orientation,
00303 unsigned char flags,
00304 int num_vertices,
00305 int num_faces,
00306 fastf_t *vertices,
00307 int *faces,
00308 fastf_t *thickness,
00309
00310
00311 struct bu_bitv *face_mode,
00312
00313
00314 int num_normals,
00315 fastf_t *normals,
00316 int *face_normals );
00317
00318
00319
00320 WDB_EXPORT int mk_bspline( struct rt_wdb *wdbp, const char *name, struct face_g_snurb **surfs );
00321
00322
00323 WDB_EXPORT int mk_nmg( struct rt_wdb *filep, const char *name, struct model *m );
00324 WDB_EXPORT int mk_bot_from_nmg( struct rt_wdb *ofp, const char *name, struct shell *s );
00325
00326 #define write_shell_as_polysolid(ofp,name,s) mk_bot_from_nmg(ofp,name,s)
00327
00328
00329 WDB_EXPORT int mk_sketch(
00330 struct rt_wdb *fp,
00331 const char *name,
00332 struct rt_sketch_internal *skt );
00333
00334
00335 WDB_EXPORT int mk_extrusion(
00336 struct rt_wdb *fp,
00337 const char *name,
00338 const char *sketch_name,
00339 const point_t V,
00340 const vect_t h,
00341 const vect_t u_vec,
00342 const vect_t v_vec,
00343 int keypoint );
00344
00345
00346 WDB_EXPORT int mk_cline(
00347 struct rt_wdb *fp,
00348 const char *name,
00349 const point_t V,
00350 const vect_t height,
00351 fastf_t radius,
00352 fastf_t thickness );
00353
00354
00355 WDB_EXPORT WDB_EXTERN(int mk_particle, (struct rt_wdb *fp, const char *name, point_t vertex,
00356 vect_t height, double vradius, double hradius) );
00357 WDB_EXPORT WDB_EXTERN(int mk_pipe, (struct rt_wdb *fp, const char *name, struct bu_list *headp) );
00358 WDB_EXPORT void mk_pipe_free( struct bu_list *headp );
00359 WDB_EXPORT void mk_add_pipe_pt(
00360 struct bu_list *headp,
00361 const point_t coord,
00362 double od,
00363 double id,
00364 double bendradius );
00365 WDB_EXPORT void mk_pipe_init( struct bu_list *headp );
00366
00367
00368 WDB_EXPORT WDB_EXTERN(int mk_dsp, (struct rt_wdb *fp, const char *name, const char *file,
00369 int xdim, int ydim, const matp_t mat));
00370 WDB_EXPORT WDB_EXTERN(int mk_ebm, (struct rt_wdb *fp, const char *name, const char *file,
00371 int xdim, int ydim, fastf_t tallness, const matp_t mat));
00372 WDB_EXPORT WDB_EXTERN(int mk_vol, (struct rt_wdb *fp, const char *name, const char *file,
00373 int xdim, int ydim, int zdim, int lo, int hi,
00374 const vect_t cellsize, const matp_t mat));
00375 WDB_EXPORT WDB_EXTERN(int mk_submodel, (struct rt_wdb *fp, const char *name, const char *file,
00376 const char *treetop, int meth));
00377 #define mk_strsol(fp,name,solid,arg) +++error_obsolete_libwdb_routine+++
00378
00379
00380
00381
00382
00383 #define mk_polysolid(fp,name) +++error_obsolete_libwdb_routine+++
00384 #define mk_poly(fp,npts,verts,norms) +++error_obsolete_libwdb_routine+++
00385 #define mk_fpoly(fp,npts,verts) +++error_obsolete_libwdb_routine+++
00386
00387
00388 WDB_EXPORT int mk_write_color_table( struct rt_wdb *ofp );
00389
00390
00391
00392 #define mk_rcomb(fp,name,len,reg,shadername,mparam,rgb,id,air,mater,los,flag) +++error_obsolete_libwdb_routine+++
00393 #define mk_fcomb(fp,name,len,reg) +++error_obsolete_libwdb_routine+++
00394 #define mk_memb(fp,name,map,op) +++error_obsolete_libwdb_routine+++
00395
00396
00397
00398
00399
00400
00401
00402 WDB_EXPORT WDB_EXTERN (struct wmember *mk_addmember,
00403 (const char *name,
00404 struct bu_list *headp,
00405 mat_t mat,
00406 int op));
00407
00408 #define mk_lcomb(_fp,_name,_headp,_rf,_shadername,_shaderargs,_rgb,_inh) \
00409 mk_comb(_fp,_name,&((_headp)->l),_rf,_shadername,_shaderargs,\
00410 _rgb,0,0,0,0,_inh,0,0)
00411
00412
00413
00414 #define mk_lrcomb(fp, name, _headp, region_flag, shadername, shaderargs, rgb, id, air, material, los, inherit_flag ) \
00415 mk_comb( fp, name, &((_headp)->l), region_flag, shadername, shaderargs, \
00416 rgb, id, air, material, los, inherit_flag, 0, 0 )
00417
00418 WDB_EXPORT int mk_comb(
00419 struct rt_wdb *wdbp,
00420 const char *combname,
00421 struct bu_list *headp,
00422 int region_kind,
00423 const char *shadername,
00424 const char *shaderargs,
00425 const unsigned char *rgb,
00426 int id,
00427 int air,
00428 int material,
00429 int los,
00430 int inherit,
00431 int append_ok,
00432 int gift_semantics);
00433
00434
00435 WDB_EXPORT int mk_comb1( struct rt_wdb *fp,
00436 const char *combname,
00437 const char *membname,
00438 int regflag );
00439 WDB_EXPORT int
00440 mk_region1(
00441 struct rt_wdb *fp,
00442 const char *combname,
00443 const char *membname,
00444 const char *shadername,
00445 const char *shaderargs,
00446 const unsigned char *rgb );
00447
00448 #define mk_fastgen_region(fp,name,headp,mode,shadername,shaderargs,rgb,id,air,material,los,inherit) \
00449 mk_comb(fp,name,headp,mode,shadername,shaderargs,rgb,id,air,\
00450 material,los,inherit,0,0)
00451
00452
00453
00454 #define WMOP_INTERSECT '+'
00455 #define WMOP_SUBTRACT '-'
00456 #define WMOP_UNION 'u'
00457
00458
00459 #define mk_lfcomb(fp,name,headp,region) mk_lcomb( fp, name, headp, \
00460 region, (char *)0, (char *)0, (unsigned char *)0, 0 );
00461
00462
00463
00464
00465 WDB_EXPORT WDB_EXTERN(int mk_conversion, (char *units_string) );
00466 WDB_EXPORT WDB_EXTERN(int mk_set_conversion, (double val) );
00467
00468
00469
00470
00471
00472 WDB_EXPORT extern double mk_conv2mm;
00473
00474
00475
00476
00477
00478 WDB_EXPORT extern int mk_version;
00479
00480
00481
00482
00483 WDB_EXPORT void mk_freemembers( struct bu_list *headp );
00484
00485 #define mk_fwrite_internal(fp,name,ip) +++error_obsolete_libwdb_routine+++
00486 #define mk_export_fwrite(wdbp,name,gp,id) wdb_export(wdbp,name,gp,id,mk_conv2mm)
00487
00488
00489
00490
00491 WDB_EXPORT WDB_EXTERN( int make_hole, ( struct rt_wdb *wdbp,
00492 point_t hole_start,
00493 vect_t hole_depth,
00494 fastf_t hole_radius,
00495 int num_objs,
00496 struct directory **dp ) );
00497
00498 WDB_EXPORT WDB_EXTERN( int make_hole_in_prepped_regions, ( struct rt_wdb *wdbp,
00499 struct rt_i *rtip,
00500 point_t hole_start,
00501 vect_t hole_depth,
00502 fastf_t radius,
00503 struct bu_ptbl *regions ) );
00504
00505
00506 __END_DECLS
00507
00508 #endif
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519