optical.h

Go to the documentation of this file.
00001 /*                            O P T I C A L . 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 /** @addtogroup liboptical */
00022 /*@{*/
00023 /** @file optical.h
00024  *@brief
00025  *  Header file for the BRL-CAD Optical Library, LIBOPTICAL.
00026  *
00027  */
00028 
00029 #ifndef SEEN_OPTICAL_H
00030 #define SEEN_OPTICAL_H seen
00031 
00032 #include "common.h"
00033 
00034 #include "bu.h"
00035 #include "shadefuncs.h"
00036 #include "shadework.h"
00037 
00038 __BEGIN_DECLS
00039 
00040 #ifndef OPTICAL_EXPORT
00041 #  if defined(_WIN32) && !defined(__CYGWIN__) && defined(BRLCAD_DLL)
00042 #    ifdef OPTICAL_EXPORT_DLL
00043 #      define OPTICAL_EXPORT __declspec(dllexport)
00044 #    else
00045 #      define OPTICAL_EXPORT __declspec(dllimport)
00046 #    endif
00047 #  else
00048 #    define OPTICAL_EXPORT
00049 #  endif
00050 #endif
00051 
00052 /* defined in init.c */
00053 OPTICAL_EXPORT extern void optical_shader_init(struct mfuncs    **headp);
00054 
00055 /* stub functions useful for debugging */
00056 /* defined in sh_text.c */
00057 OPTICAL_EXPORT extern int mlib_zero(), mlib_one();
00058 OPTICAL_EXPORT extern void      mlib_void();
00059 
00060 
00061 /* defined in refract.c */
00062 OPTICAL_EXPORT extern int
00063 rr_render(register struct application *ap,
00064           struct partition      *pp,
00065           struct shadework      *swp);
00066 
00067 /* defined in shade.c */
00068 OPTICAL_EXPORT extern void
00069 shade_inputs(struct application         *ap,
00070              const struct partition     *pp,
00071              struct shadework           *swp,
00072              int                        want);
00073 
00074 /* defined in wray.c */
00075 OPTICAL_EXPORT extern void
00076 wray(register struct partition *pp,
00077      register struct application *ap,
00078      FILE *fp,
00079      const vect_t       inormal);
00080 
00081 OPTICAL_EXPORT extern void
00082 wraypts(vect_t  in,
00083         vect_t  inorm,
00084         vect_t  out,
00085         int             id,
00086         struct application *ap,
00087         FILE    *fp);
00088 
00089 OPTICAL_EXPORT extern
00090 void wraypaint(vect_t start,
00091                vect_t norm,
00092                int paint,
00093                struct application *ap,
00094                FILE *fp);
00095 
00096 /* shade.c */
00097 OPTICAL_EXPORT extern int
00098 viewshade(struct application *ap,
00099           register const struct partition *pp,
00100           register struct shadework *swp);
00101 
00102 
00103 OPTICAL_EXPORT extern int       rdebug;
00104 
00105 /* When in production mode, no debug checking is performed, hence the
00106  * R_DEBUG define causes sections of debug code to go "poof"
00107  */
00108 #ifdef NO_DEBUG_CHECKING
00109 #       define  R_DEBUG 0
00110 #else
00111 #       define  R_DEBUG rdebug
00112 #endif
00113 
00114 /*
00115  *
00116  *
00117  *  Debugging flags for thr RT program itself.
00118  *  These flags follow the "-X" (cap X) option to the RT program.
00119  *  librt debugging is separately controlled.
00120  *
00121  *  @author
00122  *      Michael John Muuss
00123  *
00124  *  @par Source
00125  *      SECAD/VLD Computing Consortium, Bldg 394
00126  *      The U. S. Army Ballistic Research Laboratory
00127  *      Aberdeen Proving Ground, Maryland  21005
00128  */
00129 
00130 /* These definitions are each for one bit */
00131 /* Should be reogranized to put most useful ones first */
00132 #define RDEBUG_HITS     0x00000001      /* 1 Print hits used by view() */
00133 #define RDEBUG_MATERIAL 0x00000002      /* 2 Material properties */
00134 #define RDEBUG_SHOWERR  0x00000004      /* 3 Colorful markers on errors */
00135 #define RDEBUG_RTMEM    0x00000008      /* 4 Debug librt mem after startup */
00136 #define RDEBUG_SHADE    0x00000010      /* 5 Shading calculation */
00137 #define RDEBUG_PARSE    0x00000020      /* 6 Command parsing */
00138 #define RDEBUG_LIGHT    0x00000040      /* 7 Debug lighting */
00139 #define RDEBUG_REFRACT  0x00000080      /* 8 Debug reflection & refraction */
00140 
00141 #define RDEBUG_STATS    0x00000200      /* 10 Print more statistics */
00142 #define RDEBUG_RTMEM_END 0x00000400     /* 11 Print librt mem use on 'clean' */
00143 
00144 /* These will cause binary debugging output */
00145 #define RDEBUG_MISSPLOT 0x20000000      /* 30 plot(5) missed rays to stdout */
00146 #define RDEBUG_RAYWRITE 0x40000000      /* 31 Ray(5V) view rays to stdout */
00147 #define RDEBUG_RAYPLOT  0x80000000      /* 32 plot(5) rays to stdout */
00148 
00149 /* Format string for rt_printb() */
00150 #define RDEBUG_FORMAT   \
00151 "\020\040RAYPLOT\037RAYWRITE\036MISSPLOT\
00152 \013RTMEM_END\
00153 \012STATS\010REFRACT\
00154 \7LIGHT\6PARSE\5SHADE\4RTMEM\3SHOWERR\2MATERIAL\1HITS"
00155 
00156 
00157 /*
00158  *      A Bit vector to determine how much stuff rt prints when not in
00159  *      debugging mode.
00160  *
00161  */
00162 OPTICAL_EXPORT extern int       rt_verbosity;
00163 /*         flag_name            value           prints */
00164 #define VERBOSE_LIBVERSIONS  0x00000001 /* Library version strings */
00165 #define VERBOSE_MODELTITLE   0x00000002 /* model title */
00166 #define VERBOSE_TOLERANCE    0x00000004 /* model tolerance */
00167 #define VERBOSE_STATS        0x00000008 /* stats about rt_gettrees() */
00168 #define VERBOSE_FRAMENUMBER  0x00000010 /* current frame number */
00169 #define VERBOSE_VIEWDETAIL   0x00000020 /* view specifications */
00170 #define VERBOSE_LIGHTINFO    0x00000040 /* scene lights */
00171 #define VERBOSE_INCREMENTAL  0x00000080 /* progressive/incremental state */
00172 #define VERBOSE_MULTICPU     0x00000100 /* #  of CPU's to be used */
00173 #define VERBOSE_OUTPUTFILE   0x00000200 /* name of output image */
00174 
00175 #define VERBOSE_FORMAT \
00176 "\012OUTPUTFILE\011MULTICPU\010INCREMENTAL\7LIGHTINFO\6VIEWDETAIL\
00177 \5FRAMENUMBER\4STATS\3TOLERANCE\2MODELTITLE\1LIBVERSIONS"
00178 
00179 OPTICAL_EXPORT extern double AmbientIntensity;
00180 #ifdef RT_MULTISPECTRAL
00181 OPTICAL_EXPORT extern struct bn_tabdata *background;
00182 #else
00183 OPTICAL_EXPORT extern vect_t background;
00184 #endif
00185 
00186 #if 0
00187 OPTICAL_EXPORT
00188 OPTICAL_EXPORT extern
00189 #endif
00190 /* defined in sh_text.c */
00191 OPTICAL_EXPORT extern struct region env_region; /* environment map region */
00192 
00193 /* defined in refract.c */
00194 OPTICAL_EXPORT extern int max_bounces;
00195 OPTICAL_EXPORT extern int max_ireflect;
00196 
00197 /* defined in vers.c */
00198 OPTICAL_EXPORT extern const char liboptical_version[];
00199 
00200 struct floatpixel {
00201         double  ff_dist;                /**< @brief range to ff_hitpt[], <-INFINITY for miss */
00202         float   ff_hitpt[3];
00203         struct region *ff_regp;
00204         int     ff_frame;               /**< @brief >= 0 means pixel was reprojected */
00205         short   ff_x;                   /**< @brief screen x,y coords of first location */
00206         short   ff_y;
00207         char    ff_color[3];
00208 };
00209 
00210 __END_DECLS
00211 
00212 #endif /* SEEN_OPTICAL_H */
00213 /*@}*/
00214 /*
00215  * Local Variables:
00216  * mode: C
00217  * tab-width: 8
00218  * c-basic-offset: 4
00219  * indent-tabs-mode: t
00220  * End:
00221  * ex: shiftwidth=4 tabstop=8
00222  */
00223 

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