BRL-CAD
xxx.h
Go to the documentation of this file.
1 /* X X X . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2012-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 /** @file xxx.h
21  * Intersect a ray with an 'xxx' primitive object.
22  *
23  * Adding a new solid type:
24  *
25  * Design disk record
26  *
27  * define rt_xxx_internal --- parameters for solid
28  * define xxx_specific --- raytracing form, possibly w/precomputed terms
29  * define rt_xxx_parse --- struct bu_structparse for "db get", "db adjust", ...
30  *
31  * code import/export4/describe/print/ifree/plot/prep/shot/curve/uv/tess
32  *
33  * edit db.h add solidrec s_type define
34  * edit rtgeom.h to add rt_xxx_internal
35  * edit bu/magic.h to add RT_XXX_INTERNAL_MAGIC
36  * edit table.c:
37  * RT_DECLARE_INTERFACE()
38  * struct rt_functab entry
39  * rt_id_solid()
40  * edit raytrace.h to make ID_XXX, increment ID_MAXIMUM
41  * edit db_scan.c to add the new solid to db_scan()
42  * edit CMakeLists.txt to add g_xxx.c to compile
43  *
44  * go to src/libwdb and create mk_xxx() routine
45  * go to src/conv and edit g2asc.c and asc2g.c to support the new solid
46  * go to src/librt and edit tcl.c to add the new solid to
47  * rt_solid_type_lookup[]
48  * also add the interface table and to rt_id_solid() in table.c
49  * go to src/mged and create the edit support
50  *
51  */
52 
53 #ifndef LIBRT_PRIMITIVES_XXX_XXX_H
54 #define LIBRT_PRIMITIVES_XXX_XXX_H
55 
56 #include "common.h"
57 
58 #include "bu/parse.h"
59 #include "bn.h"
60 
61 
62 /* EXAMPLE_INTERNAL shows how one would store the values that describe
63  * or implement this primitive. The internal structure should go into
64  * rtgeom.h, the magic number should go into bu/magic.h, and of course
65  * the #if wrapper should go away.
66  */
67 #if defined(EXAMPLE_INTERNAL) || 1
68 
69 /* parameters for solid, internal representation */
71  uint32_t magic;
72  vect_t v;
73 };
74 
75 
76 # define RT_XXX_INTERNAL_MAGIC 0x78787878 /* 'xxxx' */
77 # define RT_XXX_CK_MAGIC(_p) BU_CKMAG(_p, RT_XXX_INTERNAL_MAGIC, "rt_xxx_internal")
78 
79 /* should set in raytrace.h to ID_MAX_SOLID and increment the max */
80 # define ID_XXX 0
81 
82 #endif
83 
84 /* ray tracing form of solid, including precomputed terms */
85 struct xxx_specific {
86  vect_t xxx_V;
87 };
88 
89 #endif /* LIBRT_PRIMITIVES_XXX_XXX_H */
90 
91 /*
92  * Local Variables:
93  * mode: C
94  * tab-width: 8
95  * indent-tabs-mode: t
96  * c-file-style: "stroustrup"
97  * End:
98  * ex: shiftwidth=4 tabstop=8
99  */
uint32_t magic
Definition: xxx.h:71
Header file for the BRL-CAD common definitions.
vect_t v
Definition: xxx.h:72
vect_t xxx_V
Definition: xxx.h:86