BRL-CAD
model.h
Go to the documentation of this file.
1 /* M O D E L . 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_model */
23 /** @{ */
24 /** @file nmg/model.h */
25 
26 #ifndef NMG_MODEL_H
27 #define NMG_MODEL_H
28 
29 #include "common.h"
30 
31 #include "vmath.h"
32 #include "bu/list.h"
33 #include "nmg/defines.h"
34 #include "nmg/topology.h"
35 
36 __BEGIN_DECLS
37 
38 #define NMG_CK_MODEL(_p) NMG_CKMAG(_p, NMG_MODEL_MAGIC, "model")
39 
40 #define GET_MODEL(p, m) {NMG_GETSTRUCT(p, model); NMG_INCR_INDEX(p, m);}
41 #define FREE_MODEL(p) NMG_FREESTRUCT(p, model)
42 
43 NMG_EXPORT extern struct model *nmg_mm(void);
44 NMG_EXPORT extern struct model *nmg_mmr(void);
45 NMG_EXPORT extern struct nmgregion *nmg_mrsv(struct model *m);
46 NMG_EXPORT extern void nmg_km(struct model *m);
47 
48 NMG_EXPORT extern void nmg_count_shell_kids(const struct model *m,
49  size_t *total_wires,
50  size_t *total_faces,
51  size_t *total_points);
52 NMG_EXPORT extern struct model *nmg_find_model(const uint32_t *magic_p);
53 NMG_EXPORT extern void nmg_model_bb(point_t min_pt,
54  point_t max_pt,
55  const struct model *m);
56 NMG_EXPORT extern struct vertex *nmg_find_pnt_in_model(const struct model *m,
57  const point_t pt,
58  const struct bn_tol *tol);
59 NMG_EXPORT extern void nmg_find_zero_length_edges(const struct model *m, struct bu_list *vlfree);
60 NMG_EXPORT extern fastf_t nmg_model_area(const struct model *m);
61 NMG_EXPORT extern void nmg_rebound(struct model *m,
62  const struct bn_tol *tol);
63 NMG_EXPORT extern struct model *nmg_mk_model_from_region(struct nmgregion *r,
64  int reindex, struct bu_list *vlfree);
65 NMG_EXPORT extern void nmg_mirror_model(struct model *m, struct bu_list *vlfree);
66 NMG_EXPORT extern int nmg_kill_zero_length_edgeuses(struct model *m);
67 NMG_EXPORT extern int nmg_edge_collapse(struct model *m,
68  const struct bn_tol *tol,
69  const fastf_t tol_coll,
70  const fastf_t min_angle,
71  struct bu_list *vlfree);
72 NMG_EXPORT extern struct model *nmg_clone_model(const struct model *original);
73 
74 NMG_EXPORT extern void nmg_triangulate_model(struct model *m,
75  struct bu_list *vlfree,
76  const struct bn_tol *tol);
77 NMG_EXPORT extern void nmg_dump_model(struct model *m);
78 NMG_EXPORT extern char *nmg_manifolds(struct model *m);
79 NMG_EXPORT extern int nmg_model_face_fuse(struct model *m,struct bu_list *vlfree,
80  const struct bn_tol *tol);
81 /* DEPRECATED: use nmg_break_e_on_v */
82 NMG_EXPORT extern int nmg_model_break_e_on_v(const uint32_t *magic_p,
83  struct bu_list *vlfree,
84  const struct bn_tol *tol);
85 NMG_EXPORT extern int nmg_model_fuse(struct model *m,
86  struct bu_list *vlfree,
87  const struct bn_tol *tol);
88 NMG_EXPORT extern void nmg_m_set_high_bit(struct model *m);
89 NMG_EXPORT extern void nmg_m_reindex(struct model *m, long newindex);
90 NMG_EXPORT extern void nmg_merge_models(struct model *m1,
91  struct model *m2);
92 NMG_EXPORT extern long nmg_find_max_index(const struct model *m);
93 
94 NMG_EXPORT extern const char *nmg_class_name(int class_no);
95 
96 __END_DECLS
97 
98 #endif /* NMG_MODEL_H */
99 /** @} */
100 /*
101  * Local Variables:
102  * mode: C
103  * tab-width: 8
104  * indent-tabs-mode: t
105  * c-file-style: "stroustrup"
106  * End:
107  * ex: shiftwidth=4 tabstop=8
108  */
Header file for the BRL-CAD common definitions.
void nmg_model_bb(point_t min_pt, point_t max_pt, const struct model *m)
void nmg_find_zero_length_edges(const struct model *m, struct bu_list *vlfree)
struct model * nmg_mm(void)
void nmg_mirror_model(struct model *m, struct bu_list *vlfree)
void nmg_triangulate_model(struct model *m, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_rebound(struct model *m, const struct bn_tol *tol)
int nmg_model_fuse(struct model *m, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_km(struct model *m)
struct vertex * nmg_find_pnt_in_model(const struct model *m, const point_t pt, const struct bn_tol *tol)
void nmg_merge_models(struct model *m1, struct model *m2)
void nmg_m_reindex(struct model *m, long newindex)
const char * nmg_class_name(int class_no)
void nmg_count_shell_kids(const struct model *m, size_t *total_wires, size_t *total_faces, size_t *total_points)
struct model * nmg_find_model(const uint32_t *magic_p)
int nmg_model_face_fuse(struct model *m, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_model_break_e_on_v(const uint32_t *magic_p, struct bu_list *vlfree, const struct bn_tol *tol)
struct model * nmg_clone_model(const struct model *original)
struct model * nmg_mk_model_from_region(struct nmgregion *r, int reindex, struct bu_list *vlfree)
struct model * nmg_mmr(void)
int nmg_kill_zero_length_edgeuses(struct model *m)
void nmg_m_set_high_bit(struct model *m)
struct nmgregion * nmg_mrsv(struct model *m)
char * nmg_manifolds(struct model *m)
int nmg_edge_collapse(struct model *m, const struct bn_tol *tol, const fastf_t tol_coll, const fastf_t min_angle, struct bu_list *vlfree)
void nmg_dump_model(struct model *m)
long nmg_find_max_index(const struct model *m)
fastf_t nmg_model_area(const struct model *m)
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:334
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:355
Definition: tol.h:72
Definition: list.h:132
NMG topological model.
Definition: topology.h:289
NMG topological region.
Definition: topology.h:277
NMG topological vertex - the simplest element of the topology system.
Definition: topology.h:98
fundamental vector, matrix, quaternion math macros