BRL-CAD
rotate_extrude.c
Go to the documentation of this file.
1 /* R O T A T E _ E X T R U D E . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2008-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 libged/rotate_extrude.c
21  *
22  * The rotate_extrude command.
23  *
24  */
25 
26 #include "common.h"
27 
28 #include <string.h>
29 
30 #include "bu/cmd.h"
31 #include "rtgeom.h"
32 #include "raytrace.h"
33 
34 #include "./ged_private.h"
35 
36 
37 int
38 _ged_rotate_extrude(struct ged *gedp, struct rt_extrude_internal *extrude, const char *attribute, matp_t rmat)
39 {
40  RT_EXTRUDE_CK_MAGIC(extrude);
41 
42  switch (attribute[0]) {
43  case 'h':
44  case 'H':
45  MAT4X3VEC(extrude->h, rmat, extrude->h);
46  break;
47  default:
48  bu_vls_printf(gedp->ged_result_str, "bad extrude attribute - %s", attribute);
49  return GED_ERROR;
50  }
51 
52  return GED_OK;
53 }
54 
55 
56 /*
57  * Local Variables:
58  * tab-width: 8
59  * mode: C
60  * indent-tabs-mode: t
61  * c-file-style: "stroustrup"
62  * End:
63  * ex: shiftwidth=4 tabstop=8
64  */
#define GED_OK
Definition: ged.h:55
Definition: ged.h:338
Header file for the BRL-CAD common definitions.
#define GED_ERROR
Definition: ged.h:61
struct bu_vls * ged_result_str
Definition: ged.h:357
int _ged_rotate_extrude(struct ged *gedp, struct rt_extrude_internal *extrude, const char *attribute, matp_t rmat)
void bu_vls_printf(struct bu_vls *vls, const char *fmt,...) _BU_ATTR_PRINTF23
Definition: vls.c:694