BRL-CAD
mater.c
Go to the documentation of this file.
1 /* M A T E R . 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/mater.c
22  *
23  * Interface for writing region-id-based color tables to the database.
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 "db.h"
36 #include "raytrace.h"
37 #include "wdb.h"
38 #include "mater.h"
39 
40 
41 int
43 {
44  RT_CK_WDB(ofp);
45  if (db_version(ofp->dbip) < 5) {
46  BU_ASSERT_LONG(mk_version, ==, 4);
47 
48  bu_log("mk_write_color_table(): not implemented for v4 database\n");
49  } else {
50  return db5_put_color_table(ofp->dbip);
51  }
52  return 0;
53 }
54 
55 
56 /*
57  * Local Variables:
58  * mode: C
59  * tab-width: 8
60  * indent-tabs-mode: t
61  * c-file-style: "stroustrup"
62  * End:
63  * ex: shiftwidth=4 tabstop=8
64  */
void bu_log(const char *,...) _BU_ATTR_PRINTF12
Definition: log.c:176
struct db_i * dbip
Definition: raytrace.h:1266
int db5_put_color_table(struct db_i *dbip)
Definition: db5_io.c:1009
#define BU_ASSERT_LONG(_lhs, _relation, _rhs)
Definition: defines.h:240
int db_version(struct db_i *dbip)
Definition: db5_scan.c:414
Header file for the BRL-CAD common definitions.
int mk_write_color_table(struct rt_wdb *ofp)
Definition: mater.c:42
#define RT_CK_WDB(_p)
Definition: raytrace.h:1292
int mk_version
Which version database to write.
Definition: export.c:38