BRL-CAD
region.h
Go to the documentation of this file.
1/* R E G I O N . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2004-2023 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_region */
23/** @{ */
24/** @file nmg/region.h */
25
26#ifndef NMG_REGION_H
27#define NMG_REGION_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_REGION(_p) NMG_CKMAG(_p, NMG_REGION_MAGIC, "region")
39#define NMG_CK_REGION_A(_p) NMG_CKMAG(_p, NMG_REGION_A_MAGIC, "region_a")
40
41#define GET_REGION(p, m) {NMG_GETSTRUCT(p, nmgregion); NMG_INCR_INDEX(p, m);}
42#define GET_REGION_A(p, m) {NMG_GETSTRUCT(p, nmgregion_a); NMG_INCR_INDEX(p, m);}
43
44#define FREE_REGION(p) NMG_FREESTRUCT(p, nmgregion)
45#define FREE_REGION_A(p) NMG_FREESTRUCT(p, nmgregion_a)
46
47NMG_EXPORT extern void nmg_region_a(struct nmgregion *r,
48 const struct bn_tol *tol);
49
50NMG_EXPORT extern void nmg_merge_regions(struct nmgregion *r1,
51 struct nmgregion *r2,
52 const struct bn_tol *tol);
53
54/* From file nmg_mk.c */
55/* MAKE routines */
56NMG_EXPORT extern struct nmgregion *nmg_mrsv(struct model *m);
57NMG_EXPORT extern struct shell *nmg_msv(struct nmgregion *r_p);
58NMG_EXPORT extern int nmg_kr(struct nmgregion *r);
59
60NMG_EXPORT extern fastf_t nmg_region_area(const struct nmgregion *r);
61NMG_EXPORT extern int nmg_unbreak_region_edges(uint32_t *magic_p, struct bu_list *vlfree);
62NMG_EXPORT extern void nmg_region_v_unique(struct nmgregion *r1, struct bu_list *vlfree,
63 const struct bn_tol *tol);
64NMG_EXPORT extern int nmg_region_both_vfuse(struct bu_ptbl *t1,
65 struct bu_ptbl *t2,
66 const struct bn_tol *tol);
67NMG_EXPORT extern struct nmgregion *nmg_do_bool(struct nmgregion *s1,
68 struct nmgregion *s2,
69 const int oper, struct bu_list *vlfree, const struct bn_tol *tol);
70NMG_EXPORT extern int nmg_two_region_vertex_fuse(struct nmgregion *r1,
71 struct nmgregion *r2,
72 const struct bn_tol *tol);
73
74__END_DECLS
75
76#endif /* NMG_REGION_H */
77/** @} */
78/*
79 * Local Variables:
80 * mode: C
81 * tab-width: 8
82 * indent-tabs-mode: t
83 * c-file-style: "stroustrup"
84 * End:
85 * ex: shiftwidth=4 tabstop=8
86 */
Header file for the BRL-CAD common definitions.
int nmg_unbreak_region_edges(uint32_t *magic_p, struct bu_list *vlfree)
void nmg_region_v_unique(struct nmgregion *r1, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_two_region_vertex_fuse(struct nmgregion *r1, struct nmgregion *r2, const struct bn_tol *tol)
struct nmgregion * nmg_do_bool(struct nmgregion *s1, struct nmgregion *s2, const int oper, struct bu_list *vlfree, const struct bn_tol *tol)
struct nmgregion * nmg_mrsv(struct model *m)
int nmg_kr(struct nmgregion *r)
void nmg_region_a(struct nmgregion *r, const struct bn_tol *tol)
struct shell * nmg_msv(struct nmgregion *r_p)
fastf_t nmg_region_area(const struct nmgregion *r)
void nmg_merge_regions(struct nmgregion *r1, struct nmgregion *r2, const struct bn_tol *tol)
int nmg_region_both_vfuse(struct bu_ptbl *t1, struct bu_ptbl *t2, const struct bn_tol *tol)
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:330
Definition: tol.h:72
Definition: list.h:131
Definition: ptbl.h:53
NMG topological model.
Definition: topology.h:289
NMG topological region.
Definition: topology.h:277
NMG topological shell.
Definition: topology.h:261
struct nmgregion * r_p
owning region
Definition: topology.h:263
fundamental vector, matrix, quaternion math macros