BRL-CAD
magic.c
Go to the documentation of this file.
1 /* M A G I C . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2014 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 
21 #include "bu/magic.h"
22 
23 const char *
24 bu_identify_magic(register uint32_t magic)
25 {
26  switch (magic) {
27  case 0:
28  return "Zero_Magic_Number";
29 
30  /*
31  * libbu
32  */
33  case BU_AVS_MAGIC:
34  return "bu_attribute_value_set";
35  case BU_BITV_MAGIC:
36  return "bu_bitv";
37  case BU_COLOR_MAGIC:
38  return "bu_color";
39  case BU_EXTERNAL_MAGIC:
40  return "bu_external";
42  return "bu_hash_entry";
44  return "bu_hash_record";
45  case BU_HASH_TBL_MAGIC:
46  return "bu_hash_table";
47  case BU_HIST_MAGIC:
48  return "bu_hist";
49  case BU_HOOK_LIST_MAGIC:
50  return "bu_hook_list";
52  return "bu_image_file";
53  case BU_LIST_HEAD_MAGIC:
54  return "bu_list";
56  return "bu_mapped_file";
57  case BU_PTBL_MAGIC:
58  return "bu_ptbl";
59  case BU_RB_LIST_MAGIC:
60  return "red-black list";
61  case BU_RB_NODE_MAGIC:
62  return "red-black node";
63  case BU_RB_PKG_MAGIC:
64  return "red-black package";
65  case BU_RB_TREE_MAGIC:
66  return "red-black tree";
67  case BN_SPM_MAGIC:
68  return "spm.h bn_spm_map_t";
69  case BU_VLB_MAGIC:
70  return "bu_vlb";
71  case BU_VLS_MAGIC:
72  return "bu_vls";
73 
74  /*
75  * libbn
76  */
77  case BN_GAUSS_MAGIC:
78  return "bn_gauss";
79  case BN_POLY_MAGIC:
80  return "bn_poly";
81  case BN_TABDATA_MAGIC:
82  return "bn_tabdata";
83  case BN_TABLE_MAGIC:
84  return "bn_table";
85  case BN_TOL_MAGIC:
86  return "bn_tol";
87  case BN_UNIF_MAGIC:
88  return "bn_unif";
89  case BN_VLBLOCK_MAGIC:
90  return "bn_vlblock";
91  case BN_VLIST_MAGIC:
92  return "bn_vlist";
93 
94  /*
95  * Primitives
96  */
98  return "rt_arbn_internal";
100  return "rt_arb_internal";
102  return "rt_ars_internal";
104  return "rt_binuf_internal";
106  return "rt_bot_internal";
108  return "rt_brep_internal";
110  return "rt_cline_internal";
112  return "rt_dsp_internal";
114  return "rt_ebm_internal";
116  return "rt_ehy_internal";
118  return "rt_ell_internal";
120  return "rt_epa_internal";
122  return "rt_eto_internal";
124  return "rt_extrude_internal";
126  return "rt_grip_internal";
128  return "rt_half_internal";
130  return "rt_hf_internal";
132  return "rt_metaball_internal";
134  return "rt_nurb_internal";
136  return "rt_part_internal";
138  return "rt_pg_internal";
140  return "rt_pipe_internal";
142  return "rt_pnts_internal";
144  return "rt_revolve_internal";
146  return "rt_rhc_internal";
148  return "rt_rpc_internal";
150  return "rt_sketch_internal";
152  return "rt_submodel_internal";
154  return "rt_superell_internal";
156  return "rt_tgc_internal";
158  return "rt_tor_internal";
160  return "rt_vol_internal";
162  return "rt_hrt_internal";
163 
164  /*
165  * N-manifold geometry
166  */
167  case NMG_EDGEUSE2_MAGIC:
168  return "edgeuse2 [midway into edgeuse]";
169  case NMG_EDGEUSE_MAGIC:
170  return "edgeuse";
172  return "edge_g_cnurb";
174  return "edge_g_lseg";
175  case NMG_EDGE_MAGIC:
176  return "edge";
177  case NMG_FACEUSE_MAGIC:
178  return "faceuse";
180  return "face_g_plane";
182  return "face_g_snurb";
183  case NMG_FACE_MAGIC:
184  return "face";
186  return "knot_vector";
187  case NMG_LOOPUSE_MAGIC:
188  return "loopuse";
189  case NMG_LOOP_G_MAGIC:
190  return "loop_g";
191  case NMG_LOOP_MAGIC:
192  return "loop";
193  case NMG_MODEL_MAGIC:
194  return "model";
195  case NMG_RADIAL_MAGIC:
196  return "radial";
197  case NMG_RAY_DATA_MAGIC:
198  return "ray_data";
199  case NMG_REGION_A_MAGIC:
200  return "region_a";
201  case NMG_REGION_MAGIC:
202  return "region";
203  case NMG_RT_HIT_MAGIC:
204  return "rt_hit";
206  return "rt_hit_sub";
207  case NMG_RT_MISS_MAGIC:
208  return "rt_miss";
209  case NMG_SHELL_A_MAGIC:
210  return "shell_a";
211  case NMG_SHELL_MAGIC:
212  return "shell";
214  return "vertexuse_a_cnurb";
216  return "vertexuse_a_plane";
217  case NMG_VERTEXUSE_MAGIC:
218  return "vertexuse";
219  case NMG_VERTEX_G_MAGIC:
220  return "vertex_g";
221  case NMG_VERTEX_MAGIC:
222  return "vertex";
223 
224  /*
225  * Raytracing
226  */
227  case RT_ANP_MAGIC:
228  return "librt Aprp";
229  case RT_AP_MAGIC:
230  return "librt application";
231  case RT_COMB_MAGIC:
232  return "librt rt_comb_internal";
233  case RT_CONSTRAINT_MAGIC:
234  return "librt rt_constraint_internal";
235  case RT_CTS_MAGIC:
236  return "librt combined_tree_state";
238  return "librt dbtr";
239  case RT_DBTS_MAGIC:
240  return "librt dbts";
242  return "rt_db_internal";
243  case RT_DIR_MAGIC:
244  return "librt directory";
245  case RT_FUNCTAB_MAGIC:
246  return "rt_functab";
247  case RT_HIT_MAGIC:
248  return "librt hit";
249  case RT_HTBL_MAGIC:
250  return "rt_htbl";
251  case RT_PIECELIST_MAGIC:
252  return "librt piecelist";
253  case RT_PIECESTATE_MAGIC:
254  return "librt piecestate";
255  case RT_RAY_MAGIC:
256  return "librt xray";
257  case RT_REGION_MAGIC:
258  return "librt region";
259  case RT_SEG_MAGIC:
260  return "librt seg";
261  case RT_SOLTAB_MAGIC:
262  return "librt soltab";
263  case RT_SOLTAB2_MAGIC:
264  return "librt soltab2";
265  case RT_TESS_TOL_MAGIC:
266  return "rt_tess_tol";
267  case RT_TREE_MAGIC:
268  return "librt union tree";
269  case RT_WDB_MAGIC:
270  return "rt_wdb";
271 
272  /*
273  * Misc
274  */
275  case ANIMATE_MAGIC:
276  return "librt animate";
277  case CURVE_BEZIER_MAGIC:
278  return "curve_bezier";
279  case CURVE_CARC_MAGIC:
280  return "curve_carc";
281  case CURVE_LSEG_MAGIC:
282  return "curve_lseg";
283  case CURVE_NURB_MAGIC:
284  return "curve_nurb";
286  return "db5 raw internal";
287  case DBI_MAGIC:
288  return "librt db_i";
289  case DB_FULL_PATH_MAGIC:
290  return "librt db_full_path";
291  case FB_MAGIC:
292  return "fb.h fb_magic";
293  case LIGHT_MAGIC:
294  return "light magic";
295  case MF_MAGIC:
296  return "mf magic";
297  case PIXEL_EXT_MAGIC:
298  return "librt pixel_ext";
299  case PL_MAGIC:
300  return "pl magic";
301  case PT_HD_MAGIC:
302  return "pt_hd magic";
303  case PT_MAGIC:
304  return "librt partition";
305  case RESOURCE_MAGIC:
306  return "librt resource";
307  case RTI_MAGIC:
308  return "rt_i";
309  case VERT_TREE_MAGIC:
310  return "vert_tree";
312  return "wdb metaball pt";
313  case WDB_PIPESEG_MAGIC:
314  return "wdb.h wdb_pipeseg_magic";
315  case WMEMBER_MAGIC:
316  return "wdb.h wmember_magic";
317 
318  }
319 
320  return "Unknown_Magic";
321 }
322 
323 /*
324  * Local Variables:
325  * mode: C
326  * tab-width: 8
327  * indent-tabs-mode: t
328  * c-file-style: "stroustrup"
329  * End:
330  * ex: shiftwidth=4 tabstop=8
331  */
#define NMG_MODEL_MAGIC
Definition: magic.h:133
#define RT_TGC_INTERNAL_MAGIC
Definition: magic.h:111
#define RT_CTS_MAGIC
Definition: magic.h:155
#define BU_COLOR_MAGIC
Definition: magic.h:48
#define RT_BINUNIF_INTERNAL_MAGIC
Definition: magic.h:84
#define NMG_EDGEUSE_MAGIC
Definition: magic.h:120
#define BU_AVS_MAGIC
Definition: magic.h:46
#define NMG_RT_HIT_MAGIC
Definition: magic.h:138
#define RT_DSP_INTERNAL_MAGIC
Definition: magic.h:88
#define RT_FUNCTAB_MAGIC
Definition: magic.h:160
#define NMG_EDGE_MAGIC
Definition: magic.h:123
#define RT_BOT_INTERNAL_MAGIC
Definition: magic.h:85
#define RT_RAY_MAGIC
Definition: magic.h:165
#define MF_MAGIC
Definition: magic.h:205
#define NMG_SHELL_MAGIC
Definition: magic.h:142
#define NMG_LOOP_G_MAGIC
Definition: magic.h:131
#define RT_DB_TRAVERSE_MAGIC
Definition: magic.h:156
#define RT_NURB_INTERNAL_MAGIC
Definition: magic.h:101
#define NMG_VERTEX_MAGIC
Definition: magic.h:147
#define DBI_MAGIC
Definition: magic.h:202
#define NMG_FACE_G_SNURB_MAGIC
Definition: magic.h:126
#define BU_HASH_RECORD_MAGIC
Definition: magic.h:51
#define RT_SOLTAB2_MAGIC
Definition: magic.h:168
#define RTI_MAGIC
Definition: magic.h:211
#define NMG_KNOT_VECTOR_MAGIC
Definition: magic.h:129
#define CURVE_CARC_MAGIC
Definition: magic.h:198
#define BN_TOL_MAGIC
Definition: magic.h:74
#define RT_HTBL_MAGIC
Definition: magic.h:162
#define BN_POLY_MAGIC
Definition: magic.h:70
#define RT_REGION_MAGIC
Definition: magic.h:166
#define RT_EBM_INTERNAL_MAGIC
Definition: magic.h:89
#define CURVE_NURB_MAGIC
Definition: magic.h:200
#define WDB_METABALLPT_MAGIC
Definition: magic.h:213
#define NMG_RADIAL_MAGIC
Definition: magic.h:134
#define RT_EPA_INTERNAL_MAGIC
Definition: magic.h:92
#define NMG_LOOPUSE_MAGIC
Definition: magic.h:130
#define DB5_RAW_INTERNAL_MAGIC
Definition: magic.h:201
#define BU_RB_NODE_MAGIC
Definition: magic.h:61
#define CURVE_BEZIER_MAGIC
Definition: magic.h:197
#define RT_DB_INTERNAL_MAGIC
Definition: magic.h:158
#define BN_TABDATA_MAGIC
Definition: magic.h:72
#define RT_PIECESTATE_MAGIC
Definition: magic.h:164
#define BU_HOOK_LIST_MAGIC
Definition: magic.h:54
#define RT_BREP_INTERNAL_MAGIC
Definition: magic.h:86
#define NMG_EDGEUSE2_MAGIC
Definition: magic.h:119
#define BU_BITV_MAGIC
Definition: magic.h:47
#define RT_AP_MAGIC
Definition: magic.h:152
#define BU_VLB_MAGIC
Definition: magic.h:64
#define RT_SUBMODEL_INTERNAL_MAGIC
Definition: magic.h:109
#define NMG_LOOP_MAGIC
Definition: magic.h:132
#define RESOURCE_MAGIC
Definition: magic.h:210
#define NMG_FACE_MAGIC
Definition: magic.h:127
#define RT_ELL_INTERNAL_MAGIC
Definition: magic.h:91
#define RT_EXTRUDE_INTERNAL_MAGIC
Definition: magic.h:94
#define ANIMATE_MAGIC
Definition: magic.h:196
#define RT_EHY_INTERNAL_MAGIC
Definition: magic.h:90
#define RT_DBTS_MAGIC
Definition: magic.h:157
#define RT_TOR_INTERNAL_MAGIC
Definition: magic.h:112
#define BU_HASH_ENTRY_MAGIC
Definition: magic.h:50
#define RT_CLINE_INTERNAL_MAGIC
Definition: magic.h:87
#define BN_UNIF_MAGIC
Definition: magic.h:75
#define NMG_RAY_DATA_MAGIC
Definition: magic.h:135
#define RT_GRIP_INTERNAL_MAGIC
Definition: magic.h:95
#define RT_HALF_INTERNAL_MAGIC
Definition: magic.h:96
#define PT_MAGIC
Definition: magic.h:209
#define BN_VLIST_MAGIC
Definition: magic.h:77
#define RT_VOL_INTERNAL_MAGIC
Definition: magic.h:113
#define NMG_SHELL_A_MAGIC
Definition: magic.h:141
#define LIGHT_MAGIC
Definition: magic.h:204
#define NMG_RT_HIT_SUB_MAGIC
Definition: magic.h:139
#define BN_VLBLOCK_MAGIC
Definition: magic.h:76
#define RT_SOLTAB_MAGIC
Definition: magic.h:169
#define RT_RPC_INTERNAL_MAGIC
Definition: magic.h:107
#define BU_RB_TREE_MAGIC
Definition: magic.h:63
oldeumate l2 magic
Definition: nmg_mod.c:3843
#define BN_SPM_MAGIC
Definition: magic.h:71
#define PT_HD_MAGIC
Definition: magic.h:208
#define BU_PTBL_MAGIC
Definition: magic.h:59
#define NMG_REGION_MAGIC
Definition: magic.h:137
#define FB_MAGIC
Definition: magic.h:180
#define VERT_TREE_MAGIC
Definition: magic.h:212
#define NMG_VERTEXUSE_MAGIC
Definition: magic.h:145
#define NMG_VERTEXUSE_A_CNURB_MAGIC
Definition: magic.h:143
#define RT_WDB_MAGIC
Definition: magic.h:172
#define NMG_FACE_G_PLANE_MAGIC
Definition: magic.h:125
#define RT_ARBN_INTERNAL_MAGIC
Definition: magic.h:81
#define RT_COMB_MAGIC
Definition: magic.h:153
#define RT_HRT_INTERNAL_MAGIC
Definition: magic.h:116
#define RT_ANP_MAGIC
Definition: magic.h:151
#define BU_MAPPED_FILE_MAGIC
Definition: magic.h:57
#define RT_TREE_MAGIC
Definition: magic.h:171
#define BU_HASH_TBL_MAGIC
Definition: magic.h:52
#define BU_HIST_MAGIC
Definition: magic.h:53
const char * bu_identify_magic(register uint32_t magic)
Definition: magic.c:24
#define NMG_EDGE_G_LSEG_MAGIC
Definition: magic.h:122
#define RT_SEG_MAGIC
Definition: magic.h:167
#define RT_ETO_INTERNAL_MAGIC
Definition: magic.h:93
#define BN_GAUSS_MAGIC
Definition: magic.h:69
#define WMEMBER_MAGIC
Definition: magic.h:215
#define NMG_EDGE_G_CNURB_MAGIC
Definition: magic.h:121
#define WDB_PIPESEG_MAGIC
Definition: magic.h:214
#define PIXEL_EXT_MAGIC
Definition: magic.h:206
#define BU_RB_PKG_MAGIC
Definition: magic.h:62
#define NMG_RT_MISS_MAGIC
Definition: magic.h:140
#define DB_FULL_PATH_MAGIC
Definition: magic.h:203
#define NMG_VERTEXUSE_A_PLANE_MAGIC
Definition: magic.h:144
#define RT_PG_INTERNAL_MAGIC
Definition: magic.h:103
#define RT_SKETCH_INTERNAL_MAGIC
Definition: magic.h:108
#define RT_REVOLVE_INTERNAL_MAGIC
Definition: magic.h:105
#define PL_MAGIC
Definition: magic.h:207
#define RT_PIECELIST_MAGIC
Definition: magic.h:163
#define RT_HF_INTERNAL_MAGIC
Definition: magic.h:97
#define NMG_REGION_A_MAGIC
Definition: magic.h:136
#define NMG_VERTEX_G_MAGIC
Definition: magic.h:146
#define RT_DIR_MAGIC
Definition: magic.h:159
#define RT_TESS_TOL_MAGIC
Definition: magic.h:170
#define BN_TABLE_MAGIC
Definition: magic.h:73
#define BU_VLS_MAGIC
Definition: magic.h:65
#define CURVE_LSEG_MAGIC
Definition: magic.h:199
#define BU_LIST_HEAD_MAGIC
Definition: magic.h:56
#define RT_PART_INTERNAL_MAGIC
Definition: magic.h:102
#define NMG_FACEUSE_MAGIC
Definition: magic.h:124
#define BU_EXTERNAL_MAGIC
Definition: magic.h:49
#define BU_RB_LIST_MAGIC
Definition: magic.h:60
#define RT_ARB_INTERNAL_MAGIC
Definition: magic.h:82
#define RT_CONSTRAINT_MAGIC
Definition: magic.h:154
#define RT_METABALL_INTERNAL_MAGIC
Definition: magic.h:100
#define BU_IMAGE_FILE_MAGIC
Definition: magic.h:55
#define RT_SUPERELL_INTERNAL_MAGIC
Definition: magic.h:110
#define RT_RHC_INTERNAL_MAGIC
Definition: magic.h:106
#define RT_ARS_INTERNAL_MAGIC
Definition: magic.h:83
#define RT_PNTS_INTERNAL_MAGIC
Definition: magic.h:114
#define RT_PIPE_INTERNAL_MAGIC
Definition: magic.h:104
#define RT_HIT_MAGIC
Definition: magic.h:161