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) 1993-2023 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 rt_debug
21 *
22 * @brief librt debugging information
23 *
24 */
25/** @{ */
26/** @file rt/debug.h */
27
28#ifndef RT_DEBUG_H
29#define RT_DEBUG_H
30
31#include "common.h"
32#include "rt/defines.h"
33
34__BEGIN_DECLS
35
36/**
37 * Each type of debugging support is independently controlled, by a
38 * separate bit in the word RT_G_DEBUG
39 *
40 * For programs based on the "RT" program, these flags follow the "-x"
41 * (lower case x) option.
42 */
43#define RT_DEBUG_OFF 0 /**< @brief No debugging */
44
45/* These definitions are each for one bit */
46
47/* Options useful for debugging applications */
48#define RT_DEBUG_ALLRAYS 0x00000001 /**< @brief 1 Print calls to rt_shootray() */
49#define RT_DEBUG_ALLHITS 0x00000002 /**< @brief 2 Print partitions passed to a_hit() */
50#define RT_DEBUG_SHOOT 0x00000004 /**< @brief 3 Info about rt_shootray() processing */
51#define RT_DEBUG_INSTANCE 0x00000008 /**< @brief 4 regionid instance revectoring */
52
53/* Options useful for debugging the database */
54#define RT_DEBUG_DB 0x00000010 /**< @brief 5 Database debugging */
55#define RT_DEBUG_SOLIDS 0x00000020 /**< @brief 6 Print prep'ed solids */
56#define RT_DEBUG_REGIONS 0x00000040 /**< @brief 7 Print regions & boolean trees */
57#define RT_DEBUG_ARB8 0x00000080 /**< @brief 8 Print voluminous ARB8 details */
58
59#define RT_DEBUG_SPLINE 0x00000100 /**< @brief 9 Splines */
60#define RT_DEBUG_ANIM 0x00000200 /**< @brief 10 Animation */
61#define RT_DEBUG_ANIM_FULL 0x00000400 /**< @brief 11 Animation matrices */
62#define RT_DEBUG_VOL 0x00000800 /**< @brief 12 Volume & opaque Binary solid */
63
64/* Options useful for debugging the library */
65#define RT_DEBUG_ROOTS 0x00001000 /**< @brief 13 Print rootfinder details */
66#define RT_DEBUG_PARTITION 0x00002000 /**< @brief 14 Info about bool_weave() */
67#define RT_DEBUG_CUT 0x00004000 /**< @brief 15 Print space cutting statistics */
68#define RT_DEBUG_BOXING 0x00008000 /**< @brief 16 Object/box checking details */
69
70#define RT_DEBUG_UNUSED_0 0x00010000 /**< @brief 17 -->> BU_DEBUG_MEM_LOG */
71#define RT_DEBUG_UNUSED_1 0x00020000 /**< @brief 18 Unassigned */
72#define RT_DEBUG_FDIFF 0x00040000 /**< @brief 19 bool/fdiff debugging */
73#define RT_DEBUG_PARALLEL 0x00080000 /**< @brief 20 -->> BU_DEBUG_PARALLEL */
74
75#define RT_DEBUG_CUTDETAIL 0x00100000 /**< @brief 21 Print space cutting details */
76#define RT_DEBUG_TREEWALK 0x00200000 /**< @brief 22 Database tree traversal */
77#define RT_DEBUG_TESTING 0x00400000 /**< @brief 23 One-shot debugging flag */
78#define RT_DEBUG_ADVANCE 0x00800000 /**< @brief 24 Cell-to-cell space partitioning */
79
80#define RT_DEBUG_MATH 0x01000000 /**< @brief 25 nmg math routines */
81
82/* Options for debugging particular solids */
83#define RT_DEBUG_EBM 0x02000000 /**< @brief 26 Extruded bit-map solids */
84#define RT_DEBUG_HF 0x04000000 /**< @brief 27 Height Field solids */
85
86#define RT_DEBUG_MESHING 0x08000000 /**< @brief 28 Print meshing/triangulation details */
87#define RT_DEBUG_UNUSED_3 0x10000000 /**< @brief 29 Unassigned */
88#define RT_DEBUG_UNUSED_4 0x20000000 /**< @brief 30 Unassigned */
89
90/* Options which will cause the library to write binary debugging output */
91#define RT_DEBUG_PL_SOLIDS 0x40000000 /**< @brief 31 plot all solids */
92#define RT_DEBUG_PL_BOX 0x80000000 /**< @brief 32 Plot(3) bounding boxes and cuts */
93
94/** Format string for bu_printb() */
95#define RT_DEBUG_FORMAT "\020" /* print hex */ \
96 "\040PL_BOX" \
97 "\037PL_SOLIDS" \
98 "\036UNUSED_4" \
99 "\035UNUSED_3" \
100 "\034UNUSED_2" \
101 "\033HF" \
102 "\032EBM" \
103 "\031MATH" \
104 "\030ADVANCE" \
105 "\027TESTING" \
106 "\026TREEWALK" \
107 "\025CUTDETAIL" \
108 "\024PARALLEL" \
109 "\023FDIFF" \
110 "\022UNUSED_1" \
111 "\021UNUSED_0" \
112 "\020BOXING" \
113 "\017CUT" \
114 "\016PARTITION" \
115 "\015ROOTS" \
116 "\014VOL" \
117 "\013ANIM_FULL" \
118 "\012ANIM" \
119 "\011SPLINE" \
120 "\010ARB8" \
121 "\7REGIONS" \
122 "\6SOLIDS" \
123 "\5DB" \
124 "\4INSTANCE" \
125 "\3SHOOT" \
126 "\2ALLHITS" \
127 "\1ALLRAYS"
128
129
130/**
131 * controls the librt debug level
132 */
133RT_EXPORT extern unsigned int rt_debug;
134
135/* Normally set when in production mode, setting the RT_G_DEBUG define
136 * to 0 will allow chucks of code to poof away at compile time (since
137 * they are truth-functionally constant (false)) This can boost
138 * raytrace performance considerably (~10%).
139 */
140#ifdef NO_DEBUG_CHECKING
141# define RT_G_DEBUG 0
142#else
143# define RT_G_DEBUG rt_debug
144#endif
145
146__END_DECLS
147
148#endif /* RT_DEBUG_H */
149/** @} */
150/*
151 * Local Variables:
152 * mode: C
153 * tab-width: 8
154 * indent-tabs-mode: t
155 * c-file-style: "stroustrup"
156 * End:
157 * ex: shiftwidth=4 tabstop=8
158 */
Header file for the BRL-CAD common definitions.
unsigned int rt_debug