BRL-CAD
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1/* G C V _ U T I L . H
2 * BRL-CAD
3 *
4 * Copyright (c) 2008-2025 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/** @file gcv/util.h
21 *
22 * Utility functions provided by the LIBGCV geometry conversion
23 * library.
24 *
25 */
26
27#ifndef GCV_UTIL_H
28#define GCV_UTIL_H
29
30#include "common.h"
31
32#include "gcv/defines.h"
33
34#include "rt/geom.h"
35#include "rt/tree.h"
36
37
39
40
41/*
42 * Tessellate the object at the specified path.
43 */
44struct rt_bot_internal *gcv_facetize(struct db_i *db, const struct db_full_path *path, const struct bn_tol *tol, const struct bg_tess_tol *tess_tol, struct bu_list *vlfree);
45
46
47/*
48 * Topological test for determining whether the given BoT satisfies
49 * the conditions for solidity.
50 *
51 * Equivalent to gcv_bot_is_closed_fan() && gcv_bot_is_orientable()
52 */
53GCV_EXPORT extern int gcv_bot_is_solid(const struct rt_bot_internal *bot);
54
55GCV_EXPORT extern int gcv_bot_is_closed_fan(const struct rt_bot_internal *bot);
56
57GCV_EXPORT extern int gcv_bot_is_orientable(const struct rt_bot_internal *bot);
58
59
60/**
61 * write_region is a function pointer to a routine that will
62 * write out the region in a given file format.
63 *
64 * This routine must be prepared to run in parallel.
65 */
67{
68 void (*write_region)(struct nmgregion *r, const struct db_full_path *pathp, struct db_tree_state *tsp, void *client_data);
69 struct bu_list *vlfree;
71};
72
73/**
74 * Perform Boolean evaluation on a tree of tessellated leaf nodes.
75 *
76 * Usually specified as the db_walk_tree() region_end callback,
77 * calling this routine for each positive region encountered.
78 *
79 * The client_data parameter is expected to point to a struct gcv_region_end_data.
80 */
81GCV_EXPORT extern union tree *gcv_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data);
82
83/**
84 * Exact same as gcv_region_end, except using the marching cubes algorithm.
85 */
86GCV_EXPORT extern union tree *gcv_region_end_mc(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data);
87
88
89GCV_EXPORT extern union tree *gcv_bottess_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data);
90
91
92GCV_EXPORT extern union tree *gcv_bottess(int argc, const char **argv, struct db_i *dbip, struct bg_tess_tol *ttol, struct bu_list *vlfree);
93
94
96
97#endif /* GCV_UTIL_H */
98
99/*
100 * Local Variables:
101 * tab-width: 8
102 * mode: C
103 * indent-tabs-mode: t
104 * c-file-style: "stroustrup"
105 * End:
106 * ex: shiftwidth=4 tabstop=8
107 */
Definition dvec.h:74
Header file for the BRL-CAD common definitions.
union tree * gcv_region_end_mc(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
int gcv_bot_is_orientable(const struct rt_bot_internal *bot)
union tree * gcv_bottess_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
union tree * gcv_region_end(struct db_tree_state *tsp, const struct db_full_path *pathp, union tree *curtree, void *client_data)
union tree * gcv_bottess(int argc, const char **argv, struct db_i *dbip, struct bg_tess_tol *ttol, struct bu_list *vlfree)
int gcv_bot_is_solid(const struct rt_bot_internal *bot)
struct rt_bot_internal * gcv_facetize(struct db_i *db, const struct db_full_path *path, const struct bn_tol *tol, const struct bg_tess_tol *tess_tol, struct bu_list *vlfree)
int gcv_bot_is_closed_fan(const struct rt_bot_internal *bot)
Definition tol.h:72
void * client_data
Definition util.h:70
struct bu_list * vlfree
Definition util.h:69
void(* write_region)(struct nmgregion *r, const struct db_full_path *pathp, struct db_tree_state *tsp, void *client_data)
Definition util.h:68
NMG topological region.
Definition topology.h:277
Definition tree.h:169