BRL-CAD
debug.h
Go to the documentation of this file.
1 /* D E B U G . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2015-2024 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 /** @addtogroup liboptical
21  *
22  * @brief
23  * Debugging logic for the BRL-CAD Optical Library, LIBOPTICAL.
24  *
25  */
26 /** @{ */
27 /** @file optical/debug.h */
28 
29 #ifndef OPTICAL_DEBUG_H
30 #define OPTICAL_DEBUG_H
31 
32 #include "common.h"
33 #include "optical/defines.h"
34 
35 __BEGIN_DECLS
36 
37 OPTICAL_EXPORT extern unsigned int optical_debug;
38 
39 /* When in production mode, no debug checking is performed, hence the
40  * R_DEBUG define causes sections of debug code to go "poof"
41  */
42 #ifdef NO_DEBUG_CHECKING
43 # define OPTICAL_DEBUG 0
44 #else
45 # define OPTICAL_DEBUG optical_debug
46 #endif
47 
48 
49 /*
50  * Debugging flags for thr RT program itself.
51  * These flags follow the "-X" (cap X) option to the RT program.
52  * librt debugging is separately controlled.
53  */
54 
55 /* These definitions are each for one bit */
56 /* Should be reorganized to put most useful ones first */
57 #define OPTICAL_DEBUG_HITS 0x00000001 /* 1 Print hits used by view() */
58 #define OPTICAL_DEBUG_MATERIAL 0x00000002 /* 2 Material properties */
59 #define OPTICAL_DEBUG_SHOWERR 0x00000004 /* 3 Colorful markers on errors */
60 #define OPTICAL_DEBUG_RTMEM 0x00000008 /* 4 Debug librt mem after startup */
61 #define OPTICAL_DEBUG_SHADE 0x00000010 /* 5 Shading calculation */
62 #define OPTICAL_DEBUG_PARSE 0x00000020 /* 6 Command parsing */
63 #define OPTICAL_DEBUG_LIGHT 0x00000040 /* 7 Debug lighting */
64 #define OPTICAL_DEBUG_REFRACT 0x00000080 /* 8 Debug reflection & refraction */
65 
66 #define OPTICAL_DEBUG_STATS 0x00000200 /* 10 Print more statistics */
67 #define OPTICAL_DEBUG_RTMEM_END 0x00000400 /* 11 Print librt mem use on 'clean' */
68 
69 /* These will cause binary debugging output */
70 #define OPTICAL_DEBUG_MISSPLOT 0x20000000 /* 30 plot(5) missed rays to stdout */
71 #define OPTICAL_DEBUG_RAYWRITE 0x40000000 /* 31 Ray(5V) view rays to stdout */
72 #define OPTICAL_DEBUG_RAYPLOT 0x80000000 /* 32 plot(5) rays to stdout */
73 
74 #define OPTICAL_DEBUG_FORMAT "\020" /* print hex */ \
75  "\040RAYPLOT" \
76  "\037RAYWRITE" \
77  "\036MISSPLOT" \
78  /* many unused */ \
79  "\013RTMEM_END" \
80  "\012STATS" \
81  "\011UNUSED" \
82  "\010REFRACT" \
83  "\7LIGHT" \
84  "\6PARSE" \
85  "\5SHADE" \
86  "\4RTMEM" \
87  "\3SHOWERR" \
88  "\2MATERIAL" \
89  "\1HITS"
90 
91 __END_DECLS
92 
93 #endif /* OPTICAL_DEBUG_H */
94 
95 /** @} */
96 /*
97  * Local Variables:
98  * mode: C
99  * tab-width: 8
100  * indent-tabs-mode: t
101  * c-file-style: "stroustrup"
102  * End:
103  * ex: shiftwidth=4 tabstop=8
104  */
Header file for the BRL-CAD common definitions.
unsigned int optical_debug