BRL-CAD
io.h
Go to the documentation of this file.
1 /* I O . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2004-2024 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 /** @addtogroup nmg_io */
23 /** @{ */
24 /** @file nmg/io.h */
25 
26 #ifndef NMG_IO_H
27 #define NMG_IO_H
28 
29 #include "common.h"
30 
31 #include "vmath.h"
32 #include "bu/parse.h"
33 #include "nmg/defines.h"
34 #include "nmg/topology.h"
35 
36 __BEGIN_DECLS
37 
38 #define V4_NAMESIZE 16
39 struct nmg_rec {
40  char N_id; /* DBID_NMG */
41  char N_version; /* Version indicator */
43  char N_pad2[2]; /* neatness */
44  unsigned char N_count[4]; /* # additional granules */
45  unsigned char N_structs[26*4];/* # of structs needed */
46 }; /* struct nmg_rec */
47 
48 
49 #define DISK_MODEL_VERSION 1 /* V0 was Release 4.0 */
50 
51 /* The last parameter is either sizeof(union record) (for v4 .g files) or
52  * 0 (for v5 and later.) */
53 NMG_EXPORT extern struct model *
54 nmg_import(const struct bu_external *ep, const mat_t mat, int record_sizeof);
55 
56 NMG_EXPORT extern int
57 nmg_export(struct bu_external *ep, struct model *m, double local2mm, int ver);
58 
59 __END_DECLS
60 
61 #endif /* NMG_MODEL_H */
62 /** @} */
63 /*
64  * Local Variables:
65  * mode: C
66  * tab-width: 8
67  * indent-tabs-mode: t
68  * c-file-style: "stroustrup"
69  * End:
70  * ex: shiftwidth=4 tabstop=8
71  */
Header file for the BRL-CAD common definitions.
#define V4_NAMESIZE
Definition: io.h:38
int nmg_export(struct bu_external *ep, struct model *m, double local2mm, int ver)
struct model * nmg_import(const struct bu_external *ep, const mat_t mat, int record_sizeof)
fastf_t mat_t[ELEMENTS_PER_MAT]
4x4 matrix
Definition: vmath.h:370
NMG topological model.
Definition: topology.h:289
Definition: io.h:39
char N_pad2[2]
Definition: io.h:43
char N_version
Definition: io.h:41
unsigned char N_count[4]
Definition: io.h:44
unsigned char N_structs[26 *4]
Definition: io.h:45
char N_id
Definition: io.h:40
char N_name[V4_NAMESIZE]
Definition: io.h:42
fundamental vector, matrix, quaternion math macros