BRL-CAD
cline.c
Go to the documentation of this file.
1 /* C L I N E . 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/cline.c
22  *
23  * Support for cline solids (kludges from FASTGEN)
24  *
25  */
26 
27 #include "common.h"
28 
29 #include <math.h>
30 #include "bio.h"
31 
32 #include "vmath.h"
33 #include "bn.h"
34 #include "rtgeom.h"
35 #include "raytrace.h"
36 #include "wdb.h"
37 
38 
39 int
41  struct rt_wdb *fp,
42  const char *name,
43  const point_t V,
44  const vect_t height,
45  fastf_t radius,
46  fastf_t thickness)
47 {
48  struct rt_cline_internal *cli;
49 
50  BU_ALLOC(cli, struct rt_cline_internal);
51  cli->magic = RT_CLINE_INTERNAL_MAGIC;
52  VMOVE(cli->v, V);
53  VMOVE(cli->h, height);
54  cli->thickness = thickness;
55  cli->radius = radius;
56 
57  return wdb_export(fp, name, (void *)cli, ID_CLINE, mk_conv2mm);
58 }
59 
60 
61 /*
62  * Local Variables:
63  * mode: C
64  * tab-width: 8
65  * indent-tabs-mode: t
66  * c-file-style: "stroustrup"
67  * End:
68  * ex: shiftwidth=4 tabstop=8
69  */
Definition: clone.c:90
Header file for the BRL-CAD common definitions.
#define ID_CLINE
FASTGEN4 CLINE solid.
Definition: raytrace.h:487
int wdb_export(struct rt_wdb *wdbp, const char *name, void *gp, int id, double local2mm)
Definition: wdb.c:265
#define BU_ALLOC(_ptr, _type)
Definition: malloc.h:223
#define RT_CLINE_INTERNAL_MAGIC
Definition: magic.h:87
double mk_conv2mm
Conversion factor to mm.
Definition: units.c:37
int mk_cline(struct rt_wdb *fp, const char *name, const point_t V, const vect_t height, fastf_t radius, fastf_t thickness)
Definition: cline.c:40
double fastf_t
Definition: defines.h:300