solid.h

Go to the documentation of this file.
00001 /*                         S O L I D . H
00002  * BRL-CAD
00003  *
00004  * Copyright (c) 1985-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 /** @addtogroup librt */
00022 /*@{*/
00023 /** @file solid.h
00024  *
00025  *      Solids structure definition
00026  *
00027  *  @author
00028  *      Michael John Muuss
00029  *
00030  *  @par Source
00031  *      SECAD/VLD Computing Consortium, Bldg 394
00032  *      The U. S. Army Ballistic Research Laboratory
00033  *      Aberdeen Proving Ground, Maryland  21005
00034  *
00035  *  $Header: /cvsroot/brlcad/brlcad/include/solid.h,v 14.9 2006/09/18 05:24:07 lbutler Exp $
00036  */
00037 #ifndef SEEN_SOLID_H
00038 #define SEEN_SOLID_H
00039 
00040 struct solid  {
00041   struct bu_list l;
00042   fastf_t s_size;       /**< @brief  Distance across solid, in model space */
00043   fastf_t s_csize;      /**< @brief  Dist across clipped solid (model space) */
00044   vect_t s_center;      /**< @brief  Center point of solid, in model space */
00045   struct bu_list s_vlist;/**< @brief  Pointer to unclipped vector list */
00046   int s_vlen;           /**< @brief  #  of actual cmd[] entries in vlist */
00047   struct db_full_path s_fullpath;
00048   char s_flag;          /**< @brief  UP = object visible, DOWN = obj invis */
00049   char s_iflag;         /**< @brief  UP = illuminated, DOWN = regular */
00050   char s_soldash;       /**< @brief  solid/dashed line flag */
00051   char s_Eflag;         /**< @brief  flag - not a solid but an "E'd" region */
00052   char s_uflag;         /**< @brief  1 - the user specified the color */
00053   char s_dflag;         /**< @brief  1 - s_basecolor is derived from the default */
00054   char s_cflag;         /**< @brief  1 - use the default color */
00055   char s_wflag;         /**< @brief  work flag */
00056   unsigned char s_basecolor[3]; /**< @brief  color from containing region */
00057   unsigned char s_color[3];     /**< @brief  color to draw as */
00058   short s_regionid;     /**< @brief  region ID */
00059   unsigned int s_dlist; /**< @brief  display list index */
00060   fastf_t s_transparency; /**< @brief  holds a transparency value in the range [0.0, 1.0] */
00061   int s_dmode;          /**< @brief  draw mode: 0 - wireframe
00062                          *            1 - shaded bots and polysolids only (booleans NOT evaluated)
00063                          *            2 - shaded (booleans NOT evaluated)
00064                          *            3 - shaded (booleans evaluated)
00065                          */
00066 };
00067 
00068 
00069 /*
00070  * "Standard" flag settings
00071  */
00072 #define UP      0
00073 #define DOWN    1
00074 
00075 #define SOLID_NULL      ((struct solid *)0)
00076 
00077 #define GET_SOLID(p,fp) { \
00078         if(BU_LIST_IS_EMPTY(fp)){ \
00079                 BU_GETSTRUCT(p,solid); \
00080                 db_full_path_init(&(p)->s_fullpath); \
00081         }else{ \
00082                 p = BU_LIST_NEXT(solid,fp); \
00083                 BU_LIST_DEQUEUE(&((p)->l)); \
00084                 (p)->s_fullpath.fp_len = 0; \
00085         } \
00086         BU_LIST_INIT( &((p)->s_vlist) ); }
00087 
00088 /** Obtain the last node (the solid) on the path */
00089 #define LAST_SOLID(_sp) DB_FULL_PATH_CUR_DIR( &(_sp)->s_fullpath )
00090 #define FIRST_SOLID(_sp)        ((_sp)->s_fullpath.fp_names[0])
00091 
00092 #define FREE_SOLID(p,fp) { \
00093         BU_LIST_APPEND(fp, &((p)->l)); \
00094         RT_FREE_VLIST(&((p)->s_vlist)); }
00095 
00096 #define FOR_ALL_SOLIDS(p,hp)  \
00097         for(BU_LIST_FOR(p,solid,hp))
00098 
00099 #define FOR_REST_OF_SOLIDS(p1,p2,hp) \
00100         for(BU_LIST_PFOR(p1,p2,solid,hp))
00101 
00102 #define BU_LIST_PFOR(p1,p2,structure,hp) \
00103         (p1)=BU_LIST_PNEXT(structure,p2); \
00104         BU_LIST_NOT_HEAD(p1,hp);\
00105         (p1)=BU_LIST_PNEXT(structure,p1)
00106 #endif
00107 /*@}*/
00108 /*
00109  * Local Variables:
00110  * mode: C
00111  * tab-width: 8
00112  * c-basic-offset: 4
00113  * indent-tabs-mode: t
00114  * End:
00115  * ex: shiftwidth=4 tabstop=8
00116  */
00117 

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