BRL-CAD
sketch.c
Go to the documentation of this file.
1 /* S K E T C H . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2000-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 /** @file libwdb/sketch.c
22  *
23  * Support for sketches
24  *
25  */
26 
27 #include "common.h"
28 
29 #include "rtgeom.h"
30 #include "raytrace.h"
31 #include "wdb.h"
32 
33 
34 int
35 mk_sketch(struct rt_wdb *fp, const char *name, const struct rt_sketch_internal *skt)
36 {
37  struct rt_sketch_internal *sketch;
38 
39  RT_SKETCH_CK_MAGIC(skt);
40 
41  /* copy the caller's struct */
42  sketch = rt_copy_sketch(skt);
43 
44  return wdb_export(fp, name, (void *)sketch, ID_SKETCH, mk_conv2mm);
45 }
46 
47 
48 /*
49  * Local Variables:
50  * mode: C
51  * tab-width: 8
52  * indent-tabs-mode: t
53  * c-file-style: "stroustrup"
54  * End:
55  * ex: shiftwidth=4 tabstop=8
56  */
Definition: clone.c:90
Header file for the BRL-CAD common definitions.
int wdb_export(struct rt_wdb *wdbp, const char *name, void *gp, int id, double local2mm)
Definition: wdb.c:265
double mk_conv2mm
Conversion factor to mm.
Definition: units.c:37
struct rt_sketch_internal * rt_copy_sketch(const struct rt_sketch_internal *sketch_ip)
Definition: sketch.c:2246
int mk_sketch(struct rt_wdb *fp, const char *name, const struct rt_sketch_internal *skt)
Definition: sketch.c:35
#define ID_SKETCH
2D sketch
Definition: raytrace.h:484