BRL-CAD
radial.h
Go to the documentation of this file.
1 /* R A D I A L . H
2  * BRL-CAD
3  *
4  * Copyright (c) 2022-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 /** @addtogroup nmg_radial
21  * @brief
22  * NMG radial definitions
23  */
24 /** @{ */
25 /** @file nmg/radial.h */
26 
27 #ifndef NMG_RADIAL_H
28 #define NMG_RADIAL_H
29 
30 #include "common.h"
31 #include "vmath.h"
32 #include "bu/list.h"
33 #include "nmg/defines.h"
34 #include "nmg/model.h"
35 
36 __BEGIN_DECLS
37 
38 struct nmg_radial {
39  struct bu_list l;
40  struct edgeuse *eu;
41  struct faceuse *fu; /**< @brief Derived from eu */
42  struct shell *s; /**< @brief Derived from eu */
43  int existing_flag; /**< @brief !0 if this eu exists on dest edge */
44  int is_crack; /**< @brief This eu is part of a crack. */
45  int is_outie; /**< @brief This crack is an "outie" */
46  int needs_flip; /**< @brief Insert eumate, not eu */
47  fastf_t ang; /**< @brief angle, in radians. 0 to 2pi */
48 };
49 
50 NMG_EXPORT extern void nmg_radial_sorted_list_insert(struct bu_list *hd,
51  struct nmg_radial *rad);
52 NMG_EXPORT extern void nmg_radial_verify_pointers(const struct bu_list *hd,
53  const struct bn_tol *tol);
54 NMG_EXPORT extern void nmg_radial_verify_monotone(const struct bu_list *hd,
55  const struct bn_tol *tol);
56 NMG_EXPORT extern void nmg_insure_radial_list_is_increasing(struct bu_list *hd,
57  fastf_t amin, fastf_t amax);
58 NMG_EXPORT extern void nmg_radial_build_list(struct bu_list *hd,
59  struct bu_ptbl *shell_tbl,
60  int existing,
61  struct edgeuse *eu,
62  const vect_t xvec,
63  const vect_t yvec,
64  const vect_t zvec,
65  const struct bn_tol *tol);
66 NMG_EXPORT extern void nmg_radial_merge_lists(struct bu_list *dest,
67  struct bu_list *src,
68  const struct bn_tol *tol);
69 NMG_EXPORT extern int nmg_is_crack_outie(const struct edgeuse *eu,
70  struct bu_list *vlfree,
71  const struct bn_tol *tol);
72 NMG_EXPORT extern struct nmg_radial *nmg_find_radial_eu(const struct bu_list *hd,
73  const struct edgeuse *eu);
74 NMG_EXPORT extern const struct edgeuse *nmg_find_next_use_of_2e_in_lu(const struct edgeuse *eu,
75  const struct edge *e1,
76  const struct edge *e2);
77 NMG_EXPORT extern void nmg_radial_mark_cracks(struct bu_list *hd,
78  const struct edge *e1,
79  const struct edge *e2,
80  struct bu_list *vlfree,
81  const struct bn_tol *tol);
82 NMG_EXPORT extern struct nmg_radial *nmg_radial_find_an_original(const struct bu_list *hd,
83  const struct shell *s,
84  const struct bn_tol *tol);
85 NMG_EXPORT extern int nmg_radial_mark_flips(struct bu_list *hd,
86  const struct shell *s,
87  const struct bn_tol *tol);
88 NMG_EXPORT extern int nmg_radial_check_parity(const struct bu_list *hd,
89  const struct bu_ptbl *shells,
90  const struct bn_tol *tol);
91 NMG_EXPORT extern void nmg_radial_implement_decisions(struct bu_list *hd,
92  const struct bn_tol *tol,
93  struct edgeuse *eu1,
94  vect_t xvec,
95  vect_t yvec,
96  vect_t zvec);
97 NMG_EXPORT extern void nmg_pr_radial(const char *title,
98  const struct nmg_radial *rad);
99 NMG_EXPORT extern void nmg_pr_radial_list(const struct bu_list *hd,
100  const struct bn_tol *tol);
101 NMG_EXPORT extern void nmg_do_radial_flips(struct bu_list *hd);
102 NMG_EXPORT extern void nmg_do_radial_join(struct bu_list *hd,
103  struct edgeuse *eu1ref,
104  vect_t xvec, vect_t yvec, vect_t zvec,
105  const struct bn_tol *tol);
106 NMG_EXPORT extern void nmg_radial_join_eu_NEW(struct edgeuse *eu1,
107  struct edgeuse *eu2,
108  const struct bn_tol *tol);
109 NMG_EXPORT extern void nmg_radial_exchange_marked(struct bu_list *hd,
110  const struct bn_tol *tol);
111 NMG_EXPORT extern void nmg_s_radial_harmonize(struct shell *s,
112  struct bu_list *vlfree,
113  const struct bn_tol *tol);
114 NMG_EXPORT extern void nmg_s_radial_check(struct shell *s,
115  struct bu_list *vlfree,
116  const struct bn_tol *tol);
117 NMG_EXPORT extern void nmg_r_radial_check(const struct nmgregion *r,
118  struct bu_list *vlfree,
119  const struct bn_tol *tol);
120 
121 
122 __END_DECLS
123 
124 #endif /* NMG_RADIAL_H */
125 /** @} */
126 /*
127  * Local Variables:
128  * tab-width: 8
129  * mode: C
130  * indent-tabs-mode: t
131  * c-file-style: "stroustrup"
132  * End:
133  * ex: shiftwidth=4 tabstop=8
134  */
Header file for the BRL-CAD common definitions.
void nmg_insure_radial_list_is_increasing(struct bu_list *hd, fastf_t amin, fastf_t amax)
void nmg_radial_join_eu_NEW(struct edgeuse *eu1, struct edgeuse *eu2, const struct bn_tol *tol)
void nmg_do_radial_flips(struct bu_list *hd)
const struct edgeuse * nmg_find_next_use_of_2e_in_lu(const struct edgeuse *eu, const struct edge *e1, const struct edge *e2)
void nmg_s_radial_harmonize(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_s_radial_check(struct shell *s, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_do_radial_join(struct bu_list *hd, struct edgeuse *eu1ref, vect_t xvec, vect_t yvec, vect_t zvec, const struct bn_tol *tol)
void nmg_radial_build_list(struct bu_list *hd, struct bu_ptbl *shell_tbl, int existing, struct edgeuse *eu, const vect_t xvec, const vect_t yvec, const vect_t zvec, const struct bn_tol *tol)
struct nmg_radial * nmg_radial_find_an_original(const struct bu_list *hd, const struct shell *s, const struct bn_tol *tol)
void nmg_radial_exchange_marked(struct bu_list *hd, const struct bn_tol *tol)
int nmg_is_crack_outie(const struct edgeuse *eu, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_radial_merge_lists(struct bu_list *dest, struct bu_list *src, const struct bn_tol *tol)
void nmg_radial_implement_decisions(struct bu_list *hd, const struct bn_tol *tol, struct edgeuse *eu1, vect_t xvec, vect_t yvec, vect_t zvec)
void nmg_pr_radial_list(const struct bu_list *hd, const struct bn_tol *tol)
void nmg_radial_mark_cracks(struct bu_list *hd, const struct edge *e1, const struct edge *e2, struct bu_list *vlfree, const struct bn_tol *tol)
void nmg_r_radial_check(const struct nmgregion *r, struct bu_list *vlfree, const struct bn_tol *tol)
int nmg_radial_check_parity(const struct bu_list *hd, const struct bu_ptbl *shells, const struct bn_tol *tol)
int nmg_radial_mark_flips(struct bu_list *hd, const struct shell *s, const struct bn_tol *tol)
void nmg_pr_radial(const char *title, const struct nmg_radial *rad)
void nmg_radial_verify_pointers(const struct bu_list *hd, const struct bn_tol *tol)
void nmg_radial_verify_monotone(const struct bu_list *hd, const struct bn_tol *tol)
struct nmg_radial * nmg_find_radial_eu(const struct bu_list *hd, const struct edgeuse *eu)
void nmg_radial_sorted_list_insert(struct bu_list *hd, struct nmg_radial *rad)
fastf_t vect_t[ELEMENTS_PER_VECT]
3-tuple vector
Definition: vmath.h:349
double fastf_t
fastest 64-bit (or larger) floating point type
Definition: vmath.h:334
Definition: tol.h:72
Definition: list.h:132
Definition: ptbl.h:53
NMG topological edge.
Definition: topology.h:144
NMG topological edge usage.
Definition: topology.h:155
NMG topological face usage.
Definition: topology.h:230
int needs_flip
Insert eumate, not eu.
Definition: radial.h:46
struct shell * s
Derived from eu.
Definition: radial.h:42
fastf_t ang
angle, in radians. 0 to 2pi
Definition: radial.h:47
struct faceuse * fu
Derived from eu.
Definition: radial.h:41
struct edgeuse * eu
Definition: radial.h:40
struct bu_list l
Definition: radial.h:39
int existing_flag
!0 if this eu exists on dest edge
Definition: radial.h:43
int is_crack
This eu is part of a crack.
Definition: radial.h:44
int is_outie
This crack is an "outie".
Definition: radial.h:45
NMG topological region.
Definition: topology.h:277
NMG topological shell.
Definition: topology.h:261
fundamental vector, matrix, quaternion math macros