BRL-CAD
Loading...
Searching...
No Matches
view.h
Go to the documentation of this file.
1/* V I E W . H
2 * BRL-CAD
3 *
4 * Copyright (c) 1993-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 rt/view.h
21 *
22 */
23
24#ifndef RT_VIEW_H
25#define RT_VIEW_H
26
27#include "common.h"
28#include "vmath.h"
29#include "bu/list.h"
30#include "bu/hash.h"
31#include "bu/ptbl.h"
32#include "bn/tol.h"
33#include "bv/defines.h"
34#include "rt/defines.h"
35
37
38
39/* Routines for managing the mesh LoD cache */
40RT_EXPORT extern void db_mesh_lod_init(struct db_i *dbip, int verbose);
41RT_EXPORT extern void db_mesh_lod_clear(struct db_i *dbip);
42RT_EXPORT extern int db_mesh_lod_update(struct db_i *dbip, const char *name);
43RT_EXPORT extern struct bv_mesh_lod *db_mesh_lod_get(struct db_i *dbip, const char *name);
44
45/**
46 * NOTE: Normally, librt doesn't have a concept of a "display" of the geometry.
47 * However for at least the plotting routines, view information is sometimes
48 * needed to produce more intelligent output. In those situations, the
49 * application will generally pass in a bv structure.
50 */
51
52/**
53 * Specifies a subset of a primitive's geometry as the target for an
54 * operation.
55 *
56 * TODO: This structure is tentative and subject to change or removal
57 * without notice.
58 */
59struct rt_selection {
60 void *obj; /**< @brief primitive-specific selection object */
61};
62
63/**
64 * TODO: This structure is tentative and subject to change or removal
65 * without notice.
66 */
67struct rt_selection_set {
68 struct bu_ptbl selections; /**< @brief holds struct rt_selection */
70 /** selection-object-specific routine that will free all memory
71 * associated with any of the stored selections
72 */
73 void (*free_selection)(struct rt_selection *);
74};
76/**
77 * Stores selections associated with an object. There is an entry in
78 * the selections table for each kind of selection (e.g. "active",
79 * "option"). The table entries are sets to allow more than one
80 * selection of the same type (e.g. multiple "option" selections).
81 *
82 * TODO: This structure is tentative and subject to change or removal
83 * without notice.
84 */
86 /** selection type -> struct rt_selection_set */
87 struct bu_hash_tbl *sets;
88};
89
90/**
91 * Analogous to a database query. Specifies how to filter and sort the
92 * selectable components of a primitive in order to find the most
93 * relevant selections for a particular application.
94 *
95 * TODO: This structure is tentative and subject to change or removal
96 * without notice.
97 */
98struct rt_selection_query {
99 point_t start; /**< @brief start point of query ray */
100 vect_t dir; /**< @brief direction of query ray */
101
102#define RT_SORT_UNSORTED 0
103#define RT_SORT_CLOSEST_TO_START 1
105};
107/**
108 * Parameters of a translation applied to a selection.
109 *
110 * TODO: This structure is tentative and subject to change or removal
111 * without notice.
112 */
114 fastf_t dx;
115 fastf_t dy;
116 fastf_t dz;
117};
119/**
120 * Describes an operation that can be applied to a selection.
122 * TODO: This structure is tentative and subject to change or removal
123 * without notice.
124 */
126#define RT_SELECTION_NOP 0
127#define RT_SELECTION_TRANSLATION 1
128 int type;
129 union {
135
136#endif /* RT_VIEW_H */
138/*
139 * Local Variables:
140 * tab-width: 8
141 * mode: C
142 * indent-tabs-mode: t
143 * c-file-style: "stroustrup"
144 * End:
145 * ex: shiftwidth=4 tabstop=8
146 */
Definition dvec.h:74
Header file for the BRL-CAD common definitions.
struct bu_hash_tbl bu_hash_tbl
Definition hash.h:48
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
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition vmath.h:355
struct bv_mesh_lod * db_mesh_lod_get(struct db_i *dbip, const char *name)
void db_mesh_lod_init(struct db_i *dbip, int verbose)
int db_mesh_lod_update(struct db_i *dbip, const char *name)
void db_mesh_lod_clear(struct db_i *dbip)
Definition ptbl.h:53
struct bu_hash_tbl * sets
Definition view.h:90
struct rt_selection_translation tran
Definition view.h:136
union rt_selection_operation::@13 parameters
point_t start
start point of query ray
Definition view.h:103
vect_t dir
direction of query ray
Definition view.h:104
struct bu_ptbl selections
holds struct rt_selection
Definition view.h:70
void(* free_selection)(struct rt_selection *)
Definition view.h:75
void * obj
primitive-specific selection object
Definition view.h:61
fundamental vector, matrix, quaternion math macros