BRL-CAD
transform.c
Go to the documentation of this file.
1 /* T R A N S F O R M . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2006-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 
22 #include "common.h"
23 
24 #include "vmath.h"
25 #include "raytrace.h"
26 
27 
28 int
29 rt_matrix_transform(struct rt_db_internal *output, const mat_t matrix, struct rt_db_internal *input, int freeflag, struct db_i *dbip, struct resource *resource)
30 {
31  int ret;
32 
33  RT_CK_DB_INTERNAL(output);
34  RT_CK_DB_INTERNAL(input);
35  RT_CK_DBI(dbip);
36  RT_CK_RESOURCE(resource);
37 
38  ret = -1;
39  if (OBJ[input->idb_type].ft_xform) {
40  ret = OBJ[input->idb_type].ft_xform(output, matrix, input, freeflag, dbip, resource);
41  }
42 
43  return ret;
44 }
45 
46 
47 /*
48  * Local Variables:
49  * mode: C
50  * tab-width: 8
51  * indent-tabs-mode: t
52  * c-file-style: "stroustrup"
53  * End:
54  * ex: shiftwidth=4 tabstop=8
55  */
Definition: raytrace.h:800
Header file for the BRL-CAD common definitions.
#define RT_CK_DB_INTERNAL(_p)
Definition: raytrace.h:207
int rt_matrix_transform(struct rt_db_internal *output, const mat_t matrix, struct rt_db_internal *input, int freeflag, struct db_i *dbip, struct resource *resource)
Definition: transform.c:29
#define RT_CK_DBI(_p)
Definition: raytrace.h:829
const struct rt_functab OBJ[]
Definition: table.c:159
#define RT_CK_RESOURCE(_p)
Definition: raytrace.h:1490
int(* ft_xform)(struct rt_db_internal *, const mat_t, struct rt_db_internal *, int, struct db_i *, struct resource *)
Definition: raytrace.h:2170