rtgeom.h

Go to the documentation of this file.
00001 /*                        R T G E O M . H
00002  * BRL-CAD
00003  *
00004  * Copyright (c) 2004-2006 United States Government as represented by
00005  * the U.S. Army Research Laboratory.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public License
00009  * as published by the Free Software Foundation; either version 2.1 of
00010  * the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful, but
00013  * WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Library General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this file; see the file named COPYING for more
00019  * information.
00020  */
00021 
00022 /** @addtogroup g_ */
00023 /*@{*/
00024 /** @file rtgeom.h
00025  *@brief
00026  *  Details of the internal forms used by the LIBRT geometry routines
00027  *  for the different solids.
00028  *
00029  *  These structures are what the struct rt_db_internal
00030  *  generic pointer idb_ptr points at,
00031  *  based on idb_type indicating a solid id ID_xxx, such as ID_TGC.
00032  *
00033  *  Depends on having machine.h, bu.h, vmath.h, and bn.h included first.
00034  *
00035  *  The proper order for including them all is:
00036  *      #  include <stdio.h>
00037  *      # include <math.h>
00038  *      # include "machine.h"
00039  *      # include "bu.h"
00040  *      # include "vmath.h"
00041  *      # include "nmg.h"
00042  *      # include "raytrace.h"
00043  *      # include "nurb.h"
00044  *      # include "rtgeom.h"
00045  *
00046  *  @author
00047  *      Michael John Muuss
00048  *
00049  *  @par Source
00050  *      SECAD/VLD Computing Consortium, Bldg 394
00051  *      The U. S. Army Ballistic Research Laboratory
00052  *      Aberdeen Proving Ground, Maryland  21005-5066
00053  *
00054  *  $Header: /cvsroot/brlcad/brlcad/include/rtgeom.h,v 14.13 2006/09/18 05:24:07 lbutler Exp $
00055  */
00056 
00057 #ifndef SEEN_RTGEOM_H
00058 #define SEEN_RTGEOM_H seen
00059 
00060 #include "common.h"
00061 
00062 __BEGIN_DECLS
00063 
00064 #undef r_a /* defined on alliant in <machine/reg.h> included in signal.h */
00065 
00066 #define NAMELEN 16      /* NAMESIZE from db.h (can't call it NAMESIZE!!!!!) */
00067 
00068 /*
00069  *      ID_TOR
00070  */
00071 struct rt_tor_internal {
00072         long    magic;
00073         point_t v;              /**< @brief  center point */
00074         vect_t  h;              /**< @brief  normal, unit length */
00075         fastf_t r_h;            /**< @brief  radius in H direction (r2) */
00076         fastf_t r_a;            /**< @brief  radius in A direction (r1) */
00077         /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
00078         vect_t  a;              /**< @brief  r_a length */
00079         vect_t  b;              /**< @brief  r_b length */
00080         fastf_t r_b;            /**< @brief  radius in B direction (typ == r_a) */
00081 };
00082 #define RT_TOR_INTERNAL_MAGIC   0x9bffed87
00083 #define RT_TOR_CK_MAGIC(_p)     BU_CKMAG(_p,RT_TOR_INTERNAL_MAGIC,"rt_tor_internal")
00084 
00085 /**
00086  *      ID_TGC and ID_REC
00087  */
00088 struct rt_tgc_internal {
00089         long    magic;
00090         vect_t  v;
00091         vect_t  h;
00092         vect_t  a;
00093         vect_t  b;
00094         vect_t  c;
00095         vect_t  d;
00096 };
00097 #define RT_TGC_INTERNAL_MAGIC   0xaabbdd87
00098 #define RT_TGC_CK_MAGIC(_p)     BU_CKMAG(_p,RT_TGC_INTERNAL_MAGIC,"rt_tgc_internal")
00099 
00100 /*
00101  *      ID_ELL, and ID_SPH
00102  */
00103 struct rt_ell_internal  {
00104         long    magic;
00105         point_t v;
00106         vect_t  a;
00107         vect_t  b;
00108         vect_t  c;
00109 };
00110 #define RT_ELL_INTERNAL_MAGIC   0x93bb23ff
00111 #define RT_ELL_CK_MAGIC(_p)     BU_CKMAG(_p,RT_ELL_INTERNAL_MAGIC,"rt_ell_internal")
00112 
00113 /*
00114  *      ID_SUPERELL
00115  */
00116 struct rt_superell_internal {
00117         long    magic;
00118         point_t v;
00119         vect_t  a;
00120         vect_t  b;
00121         vect_t  c;
00122   double n;
00123   double e;
00124 };
00125 #define RT_SUPERELL_INTERNAL_MAGIC      0xff93bb23
00126 #define RT_SUPERELL_CK_MAGIC(_p)        BU_CKMAG(_p,RT_SUPERELL_INTERNAL_MAGIC,"rt_superell_internal")
00127 
00128 /*
00129  *      ID_METABALL
00130  */
00131 struct rt_metaball_internal {
00132         long    magic;
00133         int     method;
00134         fastf_t threshold;
00135         struct bu_list  metaball_ctrl_head;
00136 };
00137 #define RT_METABALL_INTERNAL_MAGIC      0x62616c6c      /* ball */
00138 #define RT_METABALL_CK_MAGIC(_p)        BU_CKMAG(_p,RT_METABALL_INTERNAL_MAGIC,"rt_metaball_internal")
00139 
00140 /*
00141  *      ID_ARB8
00142  *
00143  *  The internal (in memory) form of an ARB8 -- 8 points in space.
00144  *  The first 4 form the "bottom" face, the second 4 form the "top" face.
00145  */
00146 struct rt_arb_internal {
00147         long    magic;
00148         point_t pt[8];
00149 };
00150 #define RT_ARB_INTERNAL_MAGIC   0x9befd010
00151 #define RT_ARB_CK_MAGIC(_p)     BU_CKMAG(_p,RT_ARB_INTERNAL_MAGIC,"rt_arb_internal")
00152 
00153 /*
00154  *      ID_ARS
00155  */
00156 struct rt_ars_internal {
00157         long    magic;
00158         int     ncurves;
00159         int     pts_per_curve;
00160         fastf_t **curves;
00161 };
00162 #define RT_ARS_INTERNAL_MAGIC   0x77ddbbe3
00163 #define RT_ARS_CK_MAGIC(_p)     BU_CKMAG(_p,RT_ARS_INTERNAL_MAGIC,"rt_ars_internal")
00164 
00165 /*
00166  *      ID_HALF
00167  */
00168 struct rt_half_internal  {
00169         long    magic;
00170         plane_t eqn;
00171 };
00172 #define RT_HALF_INTERNAL_MAGIC  0xaa87bbdd
00173 #define RT_HALF_CK_MAGIC(_p)    BU_CKMAG(_p,RT_HALF_INTERNAL_MAGIC,"rt_half_internal")
00174 
00175 /*
00176  *      ID_GRIP
00177  */
00178 struct rt_grip_internal {
00179         long    magic;
00180         point_t center;
00181         /* Remaining elemnts are used for display purposes only */
00182         vect_t  normal;
00183         fastf_t mag;
00184 };
00185 #define RT_GRIP_INTERNAL_MAGIC  0x31196205
00186 #define RT_GRIP_CK_MAGIC(_p)    BU_CKMAG(_p,RT_GRIP_INTERNAL_MAGIC,"rt_grip_internal")
00187 
00188 /**
00189  *      ID_POLY
00190  */
00191 struct rt_pg_internal {
00192         long    magic;
00193         int     npoly;
00194         struct rt_pg_face_internal {
00195                 int     npts;           /**< @brief  number of points for this polygon */
00196                 fastf_t *verts;         /**< @brief  has 3*npts elements */
00197                 fastf_t *norms;         /**< @brief  has 3*npts elements */
00198         } *poly;                        /**< @brief  has npoly elements */
00199         /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
00200         int     max_npts;               /**< @brief  maximum value of npts in poly[] */
00201 };
00202 #define RT_PG_INTERNAL_MAGIC    0x9bfed887
00203 #define RT_PG_CK_MAGIC(_p)      BU_CKMAG(_p,RT_PG_INTERNAL_MAGIC,"rt_pg_internal")
00204 
00205 /* ID_BSPLINE */
00206 #ifdef NMG_H                            /* Only if we have seen struct face_g_snurb */
00207 #ifndef SEEN_RT_NURB_INTERNAL
00208 #define SEEN_RT_NURB_INTERNAL
00209 struct rt_nurb_internal {
00210         long            magic;
00211         int             nsrf;           /**< @brief  number of surfaces */
00212         struct face_g_snurb **srfs;     /**< @brief  The surfaces themselves */
00213 };
00214 #endif
00215 
00216 #define RT_NURB_INTERNAL_MAGIC  0x002b2bdd
00217 #define RT_NURB_CK_MAGIC( _p) BU_CKMAG(_p,RT_NURB_INTERNAL_MAGIC,"rt_nurb_internal");
00218 #endif
00219 #define RT_NURB_GET_CONTROL_POINT(_s,_u,_v)     ((_s)->ctl_points[ \
00220         ((_v)*(_s)->s_size[0]+(_u))*RT_NURB_EXTRACT_COORDS((_s)->pt_type)])
00221 
00222 /*
00223  *      ID_NMG
00224  *
00225  *  The internal form of the NMG is not rt_nmg_internal, but just
00226  *  a "struct model", from nmg.h.  e.g.:
00227  *      if( intern.idb_type == ID_NMG )
00228  *              m = (struct model *)intern.idb_ptr;
00229  */
00230 
00231 /*
00232  *      ID_EBM
00233  */
00234 #define RT_EBM_NAME_LEN 256
00235 struct rt_ebm_internal  {
00236         long            magic;
00237         char            file[RT_EBM_NAME_LEN];
00238         int             xdim;           /**< @brief  X dimension (w cells) */
00239         int             ydim;           /**< @brief  Y dimension (n cells) */
00240         fastf_t         tallness;       /**< @brief  Z dimension (mm) */
00241         mat_t           mat;            /**< @brief  convert local coords to model space */
00242         /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
00243         struct bu_mapped_file   *mp;    /**< @brief  actual data */
00244 };
00245 #define RT_EBM_INTERNAL_MAGIC   0xf901b231
00246 #define RT_EBM_CK_MAGIC(_p)     BU_CKMAG(_p,RT_EBM_INTERNAL_MAGIC,"rt_ebm_internal")
00247 
00248 /*
00249  *      ID_VOL
00250  */
00251 #define RT_VOL_NAME_LEN 128
00252 struct rt_vol_internal  {
00253         long            magic;
00254         char            file[RT_VOL_NAME_LEN];
00255         int             xdim;           /**< @brief  X dimension */
00256         int             ydim;           /**< @brief  Y dimension */
00257         int             zdim;           /**< @brief  Z dimension */
00258         int             lo;             /**< @brief  Low threshold */
00259         int             hi;             /**< @brief  High threshold */
00260         vect_t          cellsize;       /**< @brief  ideal coords: size of each cell */
00261         mat_t           mat;            /**< @brief  convert local coords to model space */
00262         /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
00263         unsigned char   *map;
00264 };
00265 #define RT_VOL_INTERNAL_MAGIC   0x987ba1d0
00266 #define RT_VOL_CK_MAGIC(_p)     BU_CKMAG(_p,RT_VOL_INTERNAL_MAGIC,"rt_vol_internal")
00267 
00268 /*
00269  *      ID_HF
00270  */
00271 struct rt_hf_internal {
00272         long            magic;
00273         /* BEGIN USER SETABLE VARIABLES */
00274         char            cfile[128];     /**< @brief  name of control file (optional) */
00275         char            dfile[128];     /**< @brief  name of data file */
00276         char            fmt[8];         /**< @brief  CV style file format descriptor */
00277         int             w;              /**< @brief  # samples wide of data file.  ("i", "x") */
00278         int             n;              /**< @brief  nlines of data file.  ("j", "y") */
00279         int             shorts;         /**< @brief  !0 --> memory array is short, not float */
00280         fastf_t         file2mm;        /**< @brief  scale factor to cvt file units to mm */
00281         vect_t          v;              /**< @brief  origin of HT in model space */
00282         vect_t          x;              /**< @brief  model vect corresponding to "w" dir (will be unitized) */
00283         vect_t          y;              /**< @brief  model vect corresponding to "n" dir (will be unitized) */
00284         fastf_t         xlen;           /**< @brief  model len of HT rpp in "w" dir */
00285         fastf_t         ylen;           /**< @brief  model len of HT rpp in "n" dir */
00286         fastf_t         zscale;         /**< @brief  scale of data in ''up'' dir (after file2mm is applied) */
00287         /* END USER SETABLE VARIABLES, BEGIN INTERNAL STUFF */
00288         struct bu_mapped_file   *mp;    /**< @brief  actual data */
00289 };
00290 #define RT_HF_INTERNAL_MAGIC    0x4846494d
00291 #define RT_HF_CK_MAGIC(_p)      BU_CKMAG(_p,RT_HF_INTERNAL_MAGIC,"rt_hf_internal")
00292 
00293 /*
00294  *      ID_ARBN
00295  */
00296 struct rt_arbn_internal  {
00297         long    magic;
00298         int     neqn;
00299         plane_t *eqn;
00300 };
00301 #define RT_ARBN_INTERNAL_MAGIC  0x18236461
00302 #define RT_ARBN_CK_MAGIC(_p)    BU_CKMAG(_p,RT_ARBN_INTERNAL_MAGIC,"rt_arbn_internal")
00303 
00304 /*
00305  *      ID_PIPE
00306  */
00307 struct rt_pipe_internal {
00308         long            pipe_magic;
00309         struct bu_list  pipe_segs_head;
00310         /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
00311         int             pipe_count;
00312 };
00313 #define RT_PIPE_INTERNAL_MAGIC  0x7dd7bb3e
00314 #define RT_PIPE_CK_MAGIC(_p)    BU_CKMAG(_p,RT_PIPE_INTERNAL_MAGIC,"rt_pipe_internal")
00315 
00316 /*
00317  *      ID_PARTICLE
00318  */
00319 struct rt_part_internal {
00320         long    part_magic;
00321         point_t part_V;
00322         vect_t  part_H;
00323         fastf_t part_vrad;
00324         fastf_t part_hrad;
00325         /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
00326         int     part_type;              /**< @brief  sphere, cylinder, cone */
00327 };
00328 #define RT_PART_INTERNAL_MAGIC  0xaaccee87
00329 #define RT_PART_CK_MAGIC(_p)    BU_CKMAG(_p,RT_PART_INTERNAL_MAGIC,"rt_part_internal")
00330 
00331 #define RT_PARTICLE_TYPE_SPHERE         1
00332 #define RT_PARTICLE_TYPE_CYLINDER       2
00333 #define RT_PARTICLE_TYPE_CONE           3
00334 
00335 /*
00336  *      ID_RPC
00337  */
00338 struct rt_rpc_internal {
00339         long    rpc_magic;
00340         point_t rpc_V;  /**< @brief  rpc vertex */
00341         vect_t  rpc_H;  /**< @brief  height vector */
00342         vect_t  rpc_B;  /**< @brief  breadth vector */
00343         fastf_t rpc_r;  /**< @brief  scalar half-width of rectangular face */
00344 };
00345 #define RT_RPC_INTERNAL_MAGIC   0xaaccee88
00346 #define RT_RPC_CK_MAGIC(_p)     BU_CKMAG(_p,RT_RPC_INTERNAL_MAGIC,"rt_rpc_internal")
00347 
00348 /*
00349  *      ID_RHC
00350  */
00351 struct rt_rhc_internal {
00352         long    rhc_magic;
00353         point_t rhc_V;  /**< @brief  rhc vertex */
00354         vect_t  rhc_H;  /**< @brief  height vector */
00355         vect_t  rhc_B;  /**< @brief  breadth vector */
00356         fastf_t rhc_r;  /**< @brief  scalar half-width of rectangular face */
00357         fastf_t rhc_c;  /**< @brief  dist from hyperbola to vertex of asymptotes */
00358 };
00359 #define RT_RHC_INTERNAL_MAGIC   0xaaccee89
00360 #define RT_RHC_CK_MAGIC(_p)     BU_CKMAG(_p,RT_RHC_INTERNAL_MAGIC,"rt_rhc_internal")
00361 
00362 /*
00363  *      ID_EPA
00364  */
00365 struct rt_epa_internal {
00366         long    epa_magic;
00367         point_t epa_V;  /**< @brief  epa vertex */
00368         vect_t  epa_H;  /**< @brief  height vector */
00369         vect_t  epa_Au; /**< @brief  unit vector along semi-major axis */
00370         fastf_t epa_r1; /**< @brief  scalar semi-major axis length */
00371         fastf_t epa_r2; /**< @brief  scalar semi-minor axis length */
00372 };
00373 #define RT_EPA_INTERNAL_MAGIC   0xaaccee90
00374 #define RT_EPA_CK_MAGIC(_p)     BU_CKMAG(_p,RT_EPA_INTERNAL_MAGIC,"rt_epa_internal")
00375 
00376 /*
00377  *      ID_EHY
00378  */
00379 struct rt_ehy_internal {
00380         long    ehy_magic;
00381         point_t ehy_V;  /**< @brief  ehy vertex */
00382         vect_t  ehy_H;  /**< @brief  height vector */
00383         vect_t  ehy_Au; /**< @brief  unit vector along semi-major axis */
00384         fastf_t ehy_r1; /**< @brief  scalar semi-major axis length */
00385         fastf_t ehy_r2; /**< @brief  scalar semi-minor axis length */
00386         fastf_t ehy_c;  /**< @brief  dist from hyperbola to vertex of asymptotes */
00387 };
00388 #define RT_EHY_INTERNAL_MAGIC   0xaaccee91
00389 #define RT_EHY_CK_MAGIC(_p)     BU_CKMAG(_p,RT_EHY_INTERNAL_MAGIC,"rt_ehy_internal")
00390 
00391 /*
00392  *      ID_ETO
00393  */
00394 struct rt_eto_internal {
00395         long    eto_magic;
00396         point_t eto_V;  /**< @brief  eto vertex */
00397         vect_t  eto_N;  /**< @brief  vector normal to plane of torus */
00398         vect_t  eto_C;  /**< @brief  vector along semi-major axis of ellipse */
00399         fastf_t eto_r;  /**< @brief  scalar radius of rotation */
00400         fastf_t eto_rd; /**< @brief  scalar length of semi-minor of ellipse */
00401 };
00402 #define RT_ETO_INTERNAL_MAGIC   0xaaccee92
00403 #define RT_ETO_CK_MAGIC(_p)     BU_CKMAG(_p,RT_ETO_INTERNAL_MAGIC,"rt_eto_internal")
00404 
00405 /*
00406  *      ID_DSP
00407  */
00408 #define DSP_NAME_LEN 128
00409 struct rt_dsp_internal{
00410         long            magic;
00411 #define dsp_file dsp_name /**< @brief  for backwards compatibility */
00412         struct bu_vls   dsp_name;               /**< @brief  name of data file */
00413         unsigned int    dsp_xcnt;               /**< @brief  # samples in row of data */
00414         unsigned int    dsp_ycnt;               /**< @brief  # of columns in data */
00415         unsigned short  dsp_smooth;             /**< @brief  bool: surf normal interp */
00416 #define DSP_CUT_DIR_ADAPT       'a'
00417 #define DSP_CUT_DIR_llUR        'l'
00418 #define DSP_CUT_DIR_ULlr        'L'
00419     unsigned char   dsp_cuttype;                /**< @brief  type of cut to make */
00420 
00421         mat_t           dsp_mtos;               /**< @brief  model to solid space */
00422         /* END OF USER SETABLE VARIABLES, BEGIN INTERNAL STUFF */
00423         mat_t           dsp_stom;               /**< @brief  solid to model space
00424                                                  * computed from dsp_mtos */
00425         unsigned short  *dsp_buf;               /**< @brief  actual data */
00426         struct bu_mapped_file *dsp_mp;          /**< @brief  mapped file for data */
00427         struct rt_db_internal *dsp_bip;         /**< @brief  db object for data */
00428 #define RT_DSP_SRC_V4_FILE      '4'
00429 #define RT_DSP_SRC_FILE 'f'
00430 #define RT_DSP_SRC_OBJ  'o'
00431         char            dsp_datasrc;            /**< @brief  which type of data source */
00432 };
00433 #define RT_DSP_INTERNAL_MAGIC   0xde6
00434 #define RT_DSP_CK_MAGIC(_p)     BU_CKMAG(_p,RT_DSP_INTERNAL_MAGIC,"rt_dsp_internal")
00435 
00436 
00437 /*
00438  *      ID_SKETCH
00439  */
00440 
00441 #define SKETCH_NAME_LEN 16
00442 struct rt_sketch_internal
00443 {
00444         long            magic;
00445         point_t         V;              /**< @brief  default embedding of sketch */
00446         vect_t          u_vec;          /**< @brief  u_vec and v_vec are unit vectors defining the plane of */
00447         vect_t          v_vec;          /**< @brief  the sketch */
00448         int             vert_count;     /**< @brief  number of vertices in this sketch */
00449         point2d_t       *verts;         /**< @brief  array of 2D vertices that may be used as
00450                                          * endpoints, centers, or spline control points */
00451 /* XXX this should have a distinctive name, like rt_curve */
00452         struct curve {
00453                 int             seg_count;      /**< @brief  number of segments in this curve */
00454                 int             *reverse;       /**< @brief  array of ints indicating if segment should be reversed */
00455                 genptr_t        *segments;      /**< @brief  array of pointers to segments in this curve */
00456         } skt_curve;                            /**< @brief  the curve in this sketch */
00457 };
00458 #define RT_SKETCH_INTERNAL_MAGIC        0x736b6574      /* sket */
00459 #define RT_SKETCH_CK_MAGIC(_p)  BU_CKMAG(_p,RT_SKETCH_INTERNAL_MAGIC,"rt_sketch_internal")
00460 
00461 /*
00462  *      ID_SUBMODEL
00463  */
00464 struct rt_submodel_internal {
00465         long            magic;
00466         struct bu_vls   file;   /**< @brief  .g filename, 0-len --> this database. */
00467         struct bu_vls   treetop;        /**< @brief  one treetop only */
00468         int             meth;           /**< @brief  space partitioning method */
00469         /* other option flags (lazy prep, etc.)?? */
00470         /* REMAINING ELEMENTS PROVIDED BY IMPORT, UNUSED BY EXPORT */
00471         mat_t           root2leaf;
00472         const struct db_i *dbip;
00473 };
00474 #define RT_SUBMODEL_INTERNAL_MAGIC      0x7375626d      /**< @brief  subm */
00475 #define RT_SUBMODEL_CK_MAGIC(_p)        BU_CKMAG(_p,RT_SUBMODEL_INTERNAL_MAGIC,"rt_submodel_internal")
00476 
00477 /*
00478  *      ID_EXTRUDE
00479  */
00480 
00481 struct rt_extrude_internal
00482 {
00483         long            magic;
00484         point_t         V;      /**< @brief  vertex, start and end point of loop to be extruded */
00485         vect_t          h;      /**< @brief  extrusion vector, may not be in (u_vec X v_vec) plane */
00486         vect_t          u_vec;  /**< @brief  vector in U parameter direction */
00487         vect_t          v_vec;  /**< @brief  vector in V parameter direction */
00488         int             keypoint;       /**< @brief  index of keypoint vertex */
00489         char            *sketch_name;   /**< @brief  name of sketch object that defines
00490                                                  * the curve to be extruded */
00491         struct rt_sketch_internal       *skt;   /**< @brief  pointer to referenced sketch */
00492 };
00493 
00494 /*      Note that the u_vec and v_vec are not unit vectors, their magnitude and direction are
00495  *      used for scaling and rotation
00496  */
00497 #define RT_EXTRUDE_INTERNAL_MAGIC       0x65787472      /* extr */
00498 #define RT_EXTRUDE_CK_MAGIC(_p) BU_CKMAG(_p,RT_EXTRUDE_INTERNAL_MAGIC,"rt_extrude_internal")
00499 
00500 /*
00501  *      ID_CLINE
00502  *
00503  *      Implementation of FASTGEN CLINE element
00504  */
00505 
00506 struct rt_cline_internal
00507 {
00508         long            magic;
00509         point_t         v;
00510         vect_t          h;
00511         fastf_t         radius;
00512         fastf_t         thickness;      /**< @brief  zero thickness means volume mode */
00513 };
00514 #define RT_CLINE_INTERNAL_MAGIC         0x43767378      /* CLIN */
00515 #define RT_CLINE_CK_MAGIC(_p)   BU_CKMAG(_p,RT_CLINE_INTERNAL_MAGIC,"rt_cline_internal")
00516 
00517 /*
00518  *      ID_BOT
00519  */
00520 
00521 struct rt_bot_internal
00522 {
00523         long            magic;
00524         unsigned char   mode;
00525         unsigned char   orientation;
00526         unsigned char   bot_flags;              /**< @brief  flags, (indicates surface normals available, for example) */
00527         int             num_vertices;
00528         int             num_faces;
00529         int             *faces;                 /**< @brief  array of ints for faces [num_faces*3] */
00530         fastf_t         *vertices;              /**< @brief  array of floats for vertices [num_vertices*3] */
00531         fastf_t         *thickness;             /**< @brief  array of plate mode thicknesses (corresponds to array of faces)
00532                                                  * NULL for modes RT_BOT_SURFACE and RT_BOT_SOLID.
00533                                                  */
00534         struct bu_bitv  *face_mode;             /**< @brief  a flag for each face indicating thickness is appended to hit point
00535                                                  * in ray direction (if bit is set), otherwise thickness is centered
00536                                                  * about hit point (NULL for modes RT_BOT_SURFACE and RT_BOT_SOLID).
00537                                                  */
00538         int             num_normals;
00539         fastf_t         *normals;               /**< @brief  array of unit surface normals [num_normals*3] */
00540         int             num_face_normals;       /**< @brief  current size of the face_normals array below (number of faces in the array) */
00541         int             *face_normals;          /**< @brief  array of indices into the "normals" array, one per face vertex [num_face_normals*3] */
00542 };
00543 
00544 /* orientationss for BOT */
00545 #define RT_BOT_UNORIENTED               1       /**< @brief  unoriented triangles */
00546 #define RT_BOT_CCW                      2       /**< @brief  oriented counter-clockwise */
00547 #define RT_BOT_CW                       3       /**< @brief  oriented clockwise */
00548 
00549 /* modes for BOT */
00550 #define RT_BOT_SURFACE                  1       /**< @brief  triangles represent a surface (no volume) */
00551 #define RT_BOT_SOLID                    2       /**< @brief  triangles respresent the boundary of a solid object */
00552 #define RT_BOT_PLATE                    3       /**< @brief  triangles represent plates. Thicknesses are specified in "thickness" array,
00553                                                  * and face mode is specified in "face_mode" bit vector.
00554                                                  * This is the FASTGEN "plate" mode. Orientation is ignored. */
00555 #define RT_BOT_PLATE_NOCOS              4       /**< @brief  same as plate mode, but LOS is set equal to face thickness, not
00556                                                  * the thickness divided by the cosine of the obliquity angle */
00557 
00558 /* flags for bot_flags */
00559 #define RT_BOT_HAS_SURFACE_NORMALS    0x1     /**< @brief  This primitive may have surface normals at each face vertex */
00560 #define RT_BOT_USE_NORMALS            0x2     /**< @brief  Use the surface normals if they exist */
00561 #define RT_BOT_USE_FLOATS             0x4     /**< @brief  Use the single precision version of "tri_specific" during prep */
00562 
00563 #define RT_BOT_INTERNAL_MAGIC           0x626F7472      /* botr */
00564 #define RT_BOT_CK_MAGIC(_p)     BU_CKMAG(_p,RT_BOT_INTERNAL_MAGIC,"rt_bot_internal")
00565 
00566 __END_DECLS
00567 
00568 #endif /* SEEN_RTGEOM_H */
00569 /*@}*/
00570 /*
00571  * Local Variables:
00572  * mode: C
00573  * tab-width: 8
00574  * c-basic-offset: 4
00575  * indent-tabs-mode: t
00576  * End:
00577  * ex: shiftwidth=4 tabstop=8
00578  */
00579 

Generated on Mon Sep 18 01:24:42 2006 for BRL-CAD by  doxygen 1.4.6