BRL-CAD
view_sets.h
Go to the documentation of this file.
1 /* V I E W _ S E T S . H
2  * BRL-CAD
3  *
4  * Copyright (c) 1993-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 bv_util
21  *
22  * In applications with multiple views, those views typically share common
23  * scene objects and memory. To manage this sharing, we define view sets.
24  */
25 /** @{ */
26 /** @file bv/view_sets.h */
27 
28 #ifndef BV_VIEW_SETS_H
29 #define BV_VIEW_SETS_H
30 
31 #include "common.h"
32 #include "bv/defines.h"
33 
34 __BEGIN_DECLS
35 
36 /**
37  * Initialize an empty view set
38  */
39 BV_EXPORT void
41 
42 /**
43  * Free view set
44  */
45 BV_EXPORT void
47 
48 /**
49  * Add view v to set s, handling shared memory assignments.
50  */
51 BV_EXPORT void
52 bv_set_add_view(struct bview_set *s, struct bview *v);
53 
54 /**
55  * Remove view v from set s. If v == NULL, all views
56  * are removed from the set.
57  */
58 BV_EXPORT void
59 bv_set_rm_view(struct bview_set *s, struct bview *v);
60 
61 /**
62  * Return a bu_ptbl holding pointers to all views in set s
63  */
64 BV_EXPORT struct bu_ptbl *
66 
67 /**
68  * Return a pointer to the view with name vname, if it is present in s. If not
69  * found, returns NULL
70  */
71 BV_EXPORT struct bview *
72 bv_set_find_view(struct bview_set *s, const char *vname);
73 
74 
75 // Expose free_scene_obj for older codes - do not use in new coding
76 BV_EXPORT struct bv_scene_obj *
78 
79 
80 __END_DECLS
81 
82 /** @} */
83 
84 #endif /* BV_VIEW_SETS_H */
85 
86 /*
87  * Local Variables:
88  * mode: C
89  * tab-width: 8
90  * indent-tabs-mode: t
91  * c-file-style: "stroustrup"
92  * End:
93  * ex: shiftwidth=4 tabstop=8
94  */
Header file for the BRL-CAD common definitions.
void bv_set_free(struct bview_set *s)
void bv_set_add_view(struct bview_set *s, struct bview *v)
struct bv_scene_obj * bv_set_fsos(struct bview_set *s)
void bv_set_rm_view(struct bview_set *s, struct bview *v)
void bv_set_init(struct bview_set *s)
struct bview * bv_set_find_view(struct bview_set *s, const char *vname)
struct bu_ptbl * bv_set_views(struct bview_set *s)
Definition: ptbl.h:53
Definition: defines.h:489