BRL-CAD
Loading...
Searching...
No Matches
defines.h
Go to the documentation of this file.
1/* B 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/** @addtogroup bv_defines
21 *
22 * This header is intended to be independent of any one BRL-CAD library and is
23 * specifically intended to allow the easy definition of common display list
24 * types between otherwise independent libraries (libdm and libged, for
25 * example).
26 */
27
28#ifndef BV_DEFINES_H
29#define BV_DEFINES_H
30
31#include "common.h"
32#include "vmath.h"
33#include "bu/list.h"
34#include "bu/ptbl.h"
35#include "bu/vls.h"
36
37/** @{ */
38/** @file bv.h */
39
40#ifndef BV_EXPORT
41# if defined(BV_DLL_EXPORTS) && defined(BV_DLL_IMPORTS)
42# error "Only BV_DLL_EXPORTS or BV_DLL_IMPORTS can be defined, not both."
43# elif defined(BV_DLL_EXPORTS)
44# define BV_EXPORT COMPILER_DLLEXPORT
45# elif defined(BV_DLL_IMPORTS)
46# define BV_EXPORT COMPILER_DLLIMPORT
47# else
48# define BV_EXPORT
49# endif
50#endif
51
52#include "bg/polygon_types.h"
53#include "bv/tcl_data.h"
54#include "bv/faceplate.h"
55
57
58/* Define view ranges. The numbers -2048 and 2047 go all the way back to the
59 * original angle-distance cursor code that predates even BRL-CAD itself, but
60 * (at least right now) there doesn't seem to be any documentation of why those
61 * specific values were chosen. */
62#define BV_MAX 2047.0
63#define BV_MIN -2048.0
64#define BV_RANGE 4095.0
65/* Map +/-2048 BV space into -1.0..+1.0 :: x/2048*/
66#define INV_BV 0.00048828125
67#define INV_4096 0.000244140625
68
69
70#define BV_MINVIEWSIZE 0.0001
71#define BV_MINVIEWSCALE 0.00005
72
73#ifndef UP
74# define UP 0
75#endif
76#ifndef DOWN
77# define DOWN 1
78#endif
79
80#define BV_ANCHOR_AUTO 0
81#define BV_ANCHOR_BOTTOM_LEFT 1
82#define BV_ANCHOR_BOTTOM_CENTER 2
83#define BV_ANCHOR_BOTTOM_RIGHT 3
84#define BV_ANCHOR_MIDDLE_LEFT 4
85#define BV_ANCHOR_MIDDLE_CENTER 5
86#define BV_ANCHOR_MIDDLE_RIGHT 6
87#define BV_ANCHOR_TOP_LEFT 7
88#define BV_ANCHOR_TOP_CENTER 8
89#define BV_ANCHOR_TOP_RIGHT 9
90struct bv_label {
91 int size;
92 struct bu_vls label;
93 point_t p; // 3D base of label text
94 int line_flag; // If 1, draw a line from label anchor to target
96 int anchor; // Either closest candidate to target (AUTO), or fixed
97 int arrow; // If 1, use an arrow indicating direction from label to target
98};
99
100
101/* Note - this container holds information both for data axes and for the more
102 * elaborate visuals associated with the Archer style model axes. The latter
103 * is a superset of the former, so there should be no need for a separate data
104 * type. */
105struct bv_axes {
106 int draw;
107 point_t axes_pos; /* in model coordinates */
108 fastf_t axes_size; /* in view coordinates for HUD drawing-mode axes */
109 int line_width; /* in pixels */
111
112 /* The following are (currently) only used when drawing
113 * the faceplace HUD axes */
119 int tick_length; /* in pixels */
120 int tick_major_length; /* in pixels */
126};
127
128// Many settings have application level defaults that can be overridden for
129// individual scene objects.
130//
131// TODO - once this settles down, it will probably warrant a bu_structparse
132// for value setting
133struct bv_obj_settings {
135 int s_dmode; /**< @brief draw modes (TODO - are these accurate?):
136 * 0 - wireframe
137 * 1 - shaded bots and polysolids only (booleans NOT evaluated)
138 * 2 - shaded (booleans NOT evaluated)
139 * 3 - shaded (booleans evaluated)
140 * 4 - hidden line
141 */
142 int mixed_modes; /**< @brief when drawing, don't remove an objects view objects for other modes */
143 fastf_t transparency; /**< @brief holds a transparency value in the range [0.0, 1.0] - 1 is opaque */
146 unsigned char color[3]; /**< @brief color to draw as */
148 int s_line_width; /**< @brief current line width */
149 fastf_t s_arrow_tip_length; /**< @brief arrow tip length */
150 fastf_t s_arrow_tip_width; /**< @brief arrow tip width */
151 int draw_solid_lines_only; /**< @brief do not use dashed lines for subtraction solids */
152 int draw_non_subtract_only; /**< @brief do not visualize subtraction solids */
154#define BV_OBJ_SETTINGS_INIT {0, 0, 1.0, 0, {255, 0, 0}, 1, 0.0, 0.0, 0, 0}
155
157/* Note that it is possible for a view object to be view-only (not
158 * corresponding directly to the wireframe of a database shape) but also based
159 * off of database data. Evaluated shaded objects would be an example, as
160 * would NIRT solid shotline visualizations or overlap visualizations. The
161 * categorizations for the various types of bv_scene_obj objects would be:
162 *
163 * solid wireframe/triangles (obj.s): BV_DBOBJ_BASED
164 * rtcheck overlap visual: BV_DBOBJ_BASED & BV_VIEWONLY
165 * polygon/line/label: BV_VIEWONLY
166 *
167 * TODO - the distinction between view and db objs at this level probably needs
168 * to go away - the application (or at least higher level libraries like
169 * libged) should be the one managing the semantic meanings of objects.
170 *
171 * The distinction between objects (lines, labels, etc.) defined as
172 * bv_scene_obj VIEW ONLY objects and the faceplate elements is objects defined
173 * as bv_scene_obj objects DO exist in the 3D scene, and will move as 3D
174 * elements when the view is manipulated (although label text is drawn parallel
175 * to the view plane.) Faceplate elements exist ONLY in the HUD and are not
176 * managed as bv_scene_obj objects - they will not move with view manipulation.
177 */
178#define BV_DBOBJ_BASED 0x01
179#define BV_VIEWONLY 0x02
180#define BV_LINES 0x04
181#define BV_LABELS 0x08
182#define BV_AXES 0x10
183#define BV_POLYGONS 0x20
184#define BV_MESH_LOD 0x40
185#define BV_CSG_LOD 0x80
187struct bview;
189#define BV_DB_OBJS 0x01
190#define BV_VIEW_OBJS 0x02
191#define BV_LOCAL_OBJS 0x04
192#define BV_CHILD_OBJS 0x08
196struct bv_scene_obj {
197 struct bu_list l;
198
199 /* Internal implementation storage */
201
202 /* View object name and type id */
203 unsigned long long s_type_flags;
204 struct bu_vls s_name; /**< @brief object name (should be unique if view objects are to be addressed by name) */
205 void *s_path; /**< @brief alternative (app specific) encoding of s_name */
206 void *dp; /**< @brief app obj data */
207 mat_t s_mat; /**< @brief mat to use for internal lookup and mesh LoD drawing */
209 /* Associated bv. Note that scene objects are not assigned uniquely to
210 * one view. This value may be changed by the application in a multi-view
211 * scenario as an object is edited from multiple different views, to supply
212 * the necessary view context for editing. If the object needs to retain
213 * knowledge of its original/creation view, it should save that info
214 * internally in its s_i_data container. */
215 struct bview *s_v;
216
217 /* Knowledge of how to create/update s_vlist and the other 3D geometry data, as well as
218 * manage any custom data specific to this object */
219 void *s_i_data; /**< @brief custom view data (bv_line_seg, bv_label, bv_polyon, etc) */
220 int (*s_update_callback)(struct bv_scene_obj *, struct bview *, int); /**< @brief custom update/generator for s_vlist */
221 void (*s_free_callback)(struct bv_scene_obj *); /**< @brief free any info stored in s_i_data, s_path and draw_data */
223 /* 3D vector list geometry data */
224 struct bu_list s_vlist; /**< @brief Pointer to unclipped vector list */
225 size_t s_vlen; /**< @brief Number of actual cmd[] entries in vlist */
226
227 /* Display lists accelerate drawing when we can use them */
228 unsigned int s_dlist; /**< @brief display list index */
229 int s_dlist_mode; /**< @brief drawing mode in which display list was generated (if it doesn't match s_os.s_dmode, dlist is out of date.) */
230 int s_dlist_stale; /**< @brief set by client codes when dlist is out of date - dm must update. */
231 void (*s_dlist_free_callback)(struct bv_scene_obj *); /**< @brief free any dlist specific data */
233 /* 3D geometry metadata */
234 fastf_t s_size; /**< @brief Distance across solid, in model space */
235 fastf_t s_csize; /**< @brief Dist across clipped solid (model space) */
236 vect_t s_center; /**< @brief Center point of solid, in model space */
237 int s_displayobj; /**< @brief Vector list contains vertices in display context flag */
242 /* Display properties */
243 char s_flag; /**< @brief UP = object visible, DOWN = obj invis */
244 char s_iflag; /**< @brief UP = illuminated, DOWN = regular */
245 int s_force_draw; /**< @brief 1 = overrides s_flag and s_iflag - always draw (allows parents to force children to be visible) */
246 unsigned char s_color[3]; /**< @brief color to draw as */
247 int s_soldash; /**< @brief solid/dashed line flag: 0 = solid, 1 = dashed*/
248 int s_arrow; /**< @brief arrow flag for view object drawing routines */
249 int s_changed; /**< @brief changed flag - set by s_update_callback if a change occurred */
252 /* Adaptive plotting info.
254 * The adaptive wireframe flag is set if the wireframe was created while
255 * adaptive mode is on - this is to allow reversion to non-adaptive
256 * wireframes if the mode is switched off without the view scale changing.
257 *
258 * NOTE: We store the following NOT for controlling the drawing, but so we
259 * can determine if the vlist is current with respect to the parent view
260 * settings. These values SHOULD NOT be directly manipulated by any user
261 * facing commands (such as view obj).
262 *
263 * TODO - should the above be true? Managing the loading of appropriate
264 * geometry for individual objects based on the local settings might make
265 * sense. If we use these, perhaps the bview level settings can be removed
266 * altogether and the view won't need to care about anything except what is
267 * in the scene obj at draw time.... Maybe add these to bv_obj_settings?*/
269 int csg_obj;
270 int mesh_obj;
276 /* Scene object settings which also (potentially) have global defaults but
277 * may be overridden locally */
280 int s_inherit_settings; /**< @brief Use current obj settings when drawing children instead of their settings */
281
282 /* Settings that may be less necessary... */
285 /* Child objects of this object */
286 struct bu_ptbl children;
288 /* Parent object of this object */
289 struct bv_scene_ob *parent;
291 /* Object level pointers to parent containers. These are stored so
292 * that the object itself knows everything needed for data manipulation
293 * and it is unnecessary to explicitly pass other parameters. */
294
295 /* Reusable vlists */
296 struct bu_list *vlfree;
297
298 /* Container for reusing bv_scene_obj allocations */
301 /* View container containing this object */
302 struct bu_ptbl *otbl;
304 /* For more specialized routines not using vlists, we may need
305 * additional drawing data associated with a scene object */
307
308 /* User data to associate with this view object */
309 void *s_u_data;
311
312
314/* bv_scene_groups (one level above scene objects, conceptually equivalent
315 * to display_list) are used to capture the intent of drawing commands. For
316 * example, in the scenario where a draw command is used to visualize a comb
317 * with sub-combs a and b:
318 *
319 * ged> draw comb
320 *
321 * The drawing code will check the proposed group against existing groups,
322 * adding and removing accordingly. It will then walk the hierarchy and create
323 * bv_scene_obj instances for all solids below comb/a and comb/b as children
324 * of the scene group. Note that since we specified "comb" as the drawn
325 * object, if comb/b is removed from comb and comb/c is added, we would expect
326 * comb's displayed view to be updated to reflect its current structure. If,
327 * however, we instead did the original visualization with the commands:
328 *
329 * ged> draw comb/a
330 * ged> draw comb/b
331 *
332 * The same solids would be drawn, but conceptually the comb itself is not
333 * drawn - the two instances are. If comb/b is removed and comb/c added, we
334 * would not expect comb/c to be drawn since we never drew either that instance
335 * or its parent comb.
336 *
337 * However, if comb/a and comb/b are drawn and then comb is drawn, the new comb
338 * scene group will replace both the comb/a and comb/b groups since they are now
339 * part of a higher level object being drawn. If comb is drawn and comb/a is
340 * subsequently drawn, it will be a no-op since "comb" is already covering that
341 * case.
342 *
343 * The rule with bv_scene_group instances is their children must specify a
344 * fully realized entity - if the s_name is "/comb/a" then everything below
345 * /comb/a is drawn. If /comb/a/obj1.s is erased, new bv_scene_group
346 * entities will be needed to reflect the partial nature of /comb/a in the
347 * visualization. That requirement also propagates back up the tree. If a has
348 * obj1.s and obj2.s below it, and /comb/a/obj1.s is erased, an original
349 * "/comb" scene group will be replaced by new scene groups: /comb/a/obj2.s and
350 * /comb/b. Note that if /comb/a/obj1.s is subsequently drawn in isolation,
351 * the scene groups will not collapse back to a single comb group - the user
352 * will not at that point have explicitly issued instructions to draw comb as a
353 * whole, even though all the individual elements have been drawn. A "view
354 * simplify" command should probably be added to support collapsing to the
355 * simplest available option automatically in that situation.
356 *
357 * Note that the above rule is for explicit erasure from the drawn scene group
358 * - if the structure of /comb/a is changed the drawn object is still "comb"
359 * and the solid children of the existing group are updated to reflect the
360 * current state of comb, rather than introducing new scene groups.
361 *
362 * Much like point_t and vect_t, the distinction between a group and an
363 * individual object is largely semantic rather than a question of different
364 * data storage. A group just uses the bv_scene_obj container to store
365 * group-wide default settings, and g.children holds the individual
366 * bv_scene_obj entries corresponding to the solids. A bv_scene_obj
367 * should always map to a solid - a group may specify a solid but more
368 * typically will reference the root of a CSG tree and have solids below it.
369 * We define them to have different types only to help keep straight in the
370 * code what is a conceptually a group and what is an individual scene object.
371 *
372 * TODO - once the latest drawing code update matures, the path management
373 * done there should make the idea of a bv_scene_group moot.
374 */
375#define bv_scene_group bv_scene_obj
376
377
378/* The primary "working" data for mesh Level-of-Detail (LoD) drawing is stored
379 * in a bv_mesh_lod container.
381 * Most LoD information is deliberately hidden in the internal, but the key
382 * data needed for drawing routines and view setup are exposed. Although this
383 * data structure is primarily managed in libbg, the public data in this struct
384 * is needed at many levels of the software stack, including libbv. */
385struct bv_mesh_lod {
386
387 // The set of triangle faces to be used when drawing
388 int fcnt;
389 const int *faces;
391 // The vertices used by the faces array
392 int pcnt;
393 const point_t *points; // If using snapped points, that's this array. Else, points == points_orig.
395 const point_t *points_orig;
396
397 // Optional: per-face-vertex normals (one normal per triangle vertex - NOT
398 // one normal per vertex. I.e., a given point from points_orig may have
399 // multiple normals associated with it in different faces.)
401
402 // Bounding box of the original full-detail data
406 // The scene object using this LoD structure
407 struct bv_scene_obj *s;
409 // Pointer to the higher level LoD context associated with this LoD data
410 void *c;
411
412 // Pointer to internal LoD implementation information specific to this object
413 void *i;
414};
416/* Flags to identify categories of objects to snap */
417#define BV_SNAP_SHARED 0x1
418#define BV_SNAP_LOCAL 0x2
419#define BV_SNAP_DB 0x4
420#define BV_SNAP_VIEW 0x8
421#define BV_SNAP_TCL 0x10
423/* We encapsulate non-camera settings into a container mainly to allow for
424 * easier reuse of the same settings between different views - if a common
425 * setting set is maintained between different views, this container allows
426 * us to just point to the common set from all views using it. */
427struct bview_settings {
428 int gv_snap_lines;
429 double gv_snap_tol_factor;
430 struct bu_ptbl gv_snap_objs;
431 int gv_snap_flags;
436 // Adaptive plotting related settings - these are used when the wireframe
437 // generated by primitives is based on the view information.
440 size_t bot_threshold;
446 // Faceplate elements fall into two general categories: those which are
447 // interactively adjusted (in a geometric sense) and those which are not.
448 // The non-interactive are generally just enabled or disabled:
450 struct bv_axes gv_view_axes;
451 struct bv_grid_state gv_grid;
457 // Framebuffer visualization is possible if there is an attached dm and
458 // that dm has an associated framebuffer. If those conditions are met,
459 // this variable is used to control how the fb is visualized.
460 int gv_fb_mode; // 0 = off, 1 = overlay, 2 = underlay
461
462 // More complex are the faceplate view elements not corresponding to
463 // geometry objects but editable by the user. These aren't managed as
464 // gv_view_objs (they are HUD visuals and thus not part of the scene) so
465 // they have some unique requirements.
466 struct bv_adc_state gv_adc;
468
469
470 // Not yet implemented - mechanism for defining a set of selected view
471 // objects
473};
474
475/* A view needs to know what objects are active within it, but this is a
476 * function not just of adding and removing objects via commands like
477 * "draw" and "erase" but also what settings are active. Shared objects
478 * are common to multiple views, but if adaptive plotting is enabled the
479 * scene objects cannot also be common - the representations of the objects
480 * may be different in each view, even though the object list is shared.
481 */
482struct bview_objs {
483
484 // Container for db object groups unique to this view (typical use case is
485 // adaptive plotting, where geometry wireframes may differ from view to
486 // view and thus need unique vlists.)
488 // Container for storing bv_scene_obj elements unique to this view.
489 struct bu_ptbl *view_objs;
490
491 // Available bv_vlist entities to recycle before allocating new for local
492 // view objects. This is used only if the app doesn't supply a vlfree -
493 // normally the app should do so, so memory from one view can be reused for
494 // other views.
495 struct bu_list gv_vlfree;
496
497 /* Container for reusing bv_scene_obj allocations */
499};
501// Data for managing "knob" manipulation of views. One historical hardware
502// example of this "knob" concept of view manipulation would be Dial boxes such
503// as the Silicon Graphics SN-921, used with 3D workstations in the early days.
504// Although we've not heard of Dial boxes being used with BRL-CAD in many
505// years, the mathematics of view manipulation used to support them still
506// underpins interactions driven with inputs from modern peripherals such as
507// the mouse.
508struct bview_knobs {
509
510 /* Rate data */
511 vect_t rot_m; // rotation - model coords
512 int rot_m_flag;
514 void *rot_m_udata;
515
516 vect_t rot_o; // rotation - object coords
520
521 vect_t rot_v; // rotation - view coords
525
526 fastf_t sca; // scale
530 vect_t tra_m; // translation - model coords
534 vect_t tra_v; // translation - view coords
538 /* Absolute data */
539 vect_t rot_m_abs; // rotation - model coords
542 vect_t rot_o_abs; // rotation - object coords
545 vect_t rot_v_abs; // rotation - view coords
549
550 vect_t tra_m_abs; // translation - model coords
552
553 vect_t tra_v_abs; // translation - view coords
557
560struct bview {
561 uint32_t magic; /**< @brief magic number */
562 struct bu_vls gv_name;
563
564 /* Size info */
566 fastf_t gv_a_scale; /**< @brief absolute scale */
568 fastf_t gv_size; /**< @brief 2.0 * scale */
569 fastf_t gv_isize; /**< @brief 1.0 / size */
575 /* Information about current "window" into view. This view may not be
576 * displayed (that's up to the display managers) and it is up to the
577 * calling code to set gv_width and gv_height to the current correct values
578 * for such a display, if it is associated with this view. These
579 * definitions are needed in bview to support "view aware" algorithms that
580 * require information defining an active pixel "window" into the view. */
581 int gv_width;
582 int gv_height;
583 point2d_t gv_wmin; // view space bbox minimum of gv_width/gv_height window
584 point2d_t gv_wmax; // view space bbox maximum of gv_width/gv_height window
585
586 /* Camera info */
587 fastf_t gv_perspective; /**< @brief perspective angle */
589 vect_t gv_eye_pos; /**< @brief eye position */
591 char gv_coord; /**< @brief coordinate system */
592 char gv_rotate_about; /**< @brief indicates what point rotations are about */
598 mat_t gv_pmat; /**< @brief perspective matrix */
600 /* Keyboard/mouse info */
604 int gv_mouse_y;
607 char gv_key;
608 unsigned long gv_mod_flags;
612 /* Settings */
613 struct bview_settings *gv_s; /**< @brief shared settings supplied by user */
614 struct bview_settings gv_ls; /**< @brief locally maintained settings specific to view (used if gv_s is null) */
616 /* If a view is marked as independent, its local containers are used even
617 * if pointers to shared tables are set. This allows for fully independent
618 * views with the same GED instance, at the cost of increased memory usage
619 * if multiple views draw the same objects. */
620 int independent;
621
622 /* Set containing this view. Also holds pointers to resources shared
623 * across multiple views */
624 struct bview_set *vset;
626 /* Scene objects active in a view. Managing these is a relatively complex
627 * topic and depends on whether a view is shared, independent or adaptive.
628 * Shared objects are common across views to make more efficient use of
629 * system memory. */
630 struct bview_objs gv_objs;
631
632 /* We sometimes need to define the volume in space that is "active" for the
633 * view. For an orthogonal camera this is the oriented bounding box
634 * extruded to contain active scene objects visible in the view The app
635 * must set the gv_bounds_update callback to bg_view_bound so a bv_update
636 * call can update these values.*/
641 void (*gv_bounds_update)(struct bview *);
643 /* "Backed out" point, lookat direction, scene radius. Used for geometric
644 * view based interrogation. */
647 double radius;
648
649 /* Knob-based view manipulation data */
652 /* Virtual trackball position */
654
655 // libtclcad data
656 struct bv_data_tclcad gv_tcl;
657
658 /* Callback, external data */
659 void (*gv_callback)(struct bview *, void *); /**< @brief called in ged_view_update with gvp and gv_clientData */
660 void *gv_clientData; /**< @brief passed to gv_callback */
662 void *dmp; /* Display manager pointer, if one is associated with this view */
663 void *u_data; /* Caller data associated with this view */
666// Because bview instances frequently share objects in applications, they are
667// not always fully independent - we define a container and some basic
668// operations to manage this.
669struct bview_set_internal;
670struct bview_set {
671 struct bview_set_internal *i;
673};
674
677#endif /* BV_DEFINES_H */
678
679/** @} */
680/*
681 * Local Variables:
682 * mode: C
683 * tab-width: 8
684 * indent-tabs-mode: t
685 * c-file-style: "stroustrup"
686 * End:
687 * ex: shiftwidth=4 tabstop=8
688 */
Definition dvec.h:74
Header file for the BRL-CAD common definitions.
todo once this settles down
Definition defines.h:132
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 mat_t[ELEMENTS_PER_MAT]
4x4 matrix
Definition vmath.h:370
fastf_t point2d_t[ELEMENTS_PER_POINT2D]
2-tuple point
Definition vmath.h:343
fastf_t point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition vmath.h:355
Definition ptbl.h:53
Definition vls.h:53
int tick_major_color[3]
Definition defines.h:125
int draw
Definition defines.h:106
int pos_only
Definition defines.h:114
int tick_color[3]
Definition defines.h:124
int ticks_per_major
Definition defines.h:122
point_t axes_pos
Definition defines.h:107
int line_width
Definition defines.h:109
int tick_enabled
Definition defines.h:118
int tick_major_length
Definition defines.h:120
fastf_t tick_interval
Definition defines.h:121
int tick_threshold
Definition defines.h:123
int axes_color[3]
Definition defines.h:110
int tick_length
Definition defines.h:119
int label_color[3]
Definition defines.h:116
int label_flag
Definition defines.h:115
fastf_t axes_size
Definition defines.h:108
int triple_color
Definition defines.h:117
int anchor
Definition defines.h:96
int size
Definition defines.h:91
struct bu_vls label
Definition defines.h:92
point_t p
Definition defines.h:93
int line_flag
Definition defines.h:94
int arrow
Definition defines.h:97
point_t target
Definition defines.h:95
struct bv_scene_obj * s
Definition defines.h:412
const point_t * points
Definition defines.h:398
void * i
Definition defines.h:418
const vect_t * normals
Definition defines.h:405
const point_t * points_orig
Definition defines.h:400
const int * faces
Definition defines.h:394
point_t bmax
Definition defines.h:409
void * c
Definition defines.h:415
point_t bmin
Definition defines.h:408
int porig_cnt
Definition defines.h:399
int draw_non_subtract_only
do not visualize subtraction solids
Definition defines.h:154
int s_dmode
draw modes (
Definition defines.h:136
int s_line_width
current line width
Definition defines.h:150
fastf_t s_arrow_tip_length
arrow tip length
Definition defines.h:151
unsigned char color[3]
color to draw as
Definition defines.h:148
int draw_solid_lines_only
do not use dashed lines for subtraction solids
Definition defines.h:153
fastf_t s_arrow_tip_width
arrow tip width
Definition defines.h:152
int mixed_modes
when drawing, don't remove an objects view objects for other modes
Definition defines.h:144
fastf_t transparency
holds a transparency value in the range [0.0, 1.0] - 1 is opaque
Definition defines.h:145
void * draw_data
Definition defines.h:310
size_t bot_threshold
Definition defines.h:276
struct bv_scene_obj * free_scene_obj
Definition defines.h:303
struct bu_ptbl * otbl
Definition defines.h:306
void * s_path
alternative (app specific) encoding of s_name
Definition defines.h:208
vect_t s_center
Center point of solid, in model space.
Definition defines.h:239
char s_iflag
UP = illuminated, DOWN = regular.
Definition defines.h:247
unsigned char s_color[3]
color to draw as
Definition defines.h:249
fastf_t view_scale
Definition defines.h:275
void * s_i_data
custom view data (bv_line_seg, bv_label, bv_polyon, etc)
Definition defines.h:222
void(* s_free_callback)(struct bv_scene_obj *)
free any info stored in s_i_data, s_path and draw_data
Definition defines.h:224
fastf_t curve_scale
Definition defines.h:277
fastf_t s_csize
Dist across clipped solid (model space)
Definition defines.h:238
mat_t s_mat
mat to use for internal lookup and mesh LoD drawing
Definition defines.h:210
struct bu_ptbl children
Definition defines.h:290
fastf_t point_scale
Definition defines.h:278
char s_flag
UP = object visible, DOWN = obj invis.
Definition defines.h:246
fastf_t s_size
Distance across solid, in model space.
Definition defines.h:237
unsigned long long s_type_flags
Definition defines.h:206
size_t s_vlen
Number of actual cmd[] entries in vlist.
Definition defines.h:228
point_t bmax
Definition defines.h:242
void(* s_dlist_free_callback)(struct bv_scene_obj *)
free any dlist specific data
Definition defines.h:234
struct bv_obj_settings s_local_os
Definition defines.h:283
point_t bmin
Definition defines.h:241
int s_dlist_mode
drawing mode in which display list was generated (if it doesn't match s_os.s_dmode,...
Definition defines.h:232
struct bu_list s_vlist
Pointer to unclipped vector list.
Definition defines.h:227
int s_dlist_stale
set by client codes when dlist is out of date - dm must update.
Definition defines.h:233
int s_inherit_settings
Use current obj settings when drawing children instead of their settings.
Definition defines.h:284
struct bu_list l
Definition defines.h:200
struct bv_scene_obj_internal * i
Definition defines.h:203
int(* s_update_callback)(struct bv_scene_obj *, struct bview *, int)
custom update/generator for s_vlist
Definition defines.h:223
int adaptive_wireframe
Definition defines.h:272
int s_displayobj
Vector list contains vertices in display context flag.
Definition defines.h:240
void * dp
app obj data
Definition defines.h:209
int s_arrow
arrow flag for view object drawing routines
Definition defines.h:251
int s_force_draw
1 = overrides s_flag and s_iflag - always draw (allows parents to force children to be visible)
Definition defines.h:248
int s_changed
changed flag - set by s_update_callback if a change occurred
Definition defines.h:252
struct bview * s_v
Definition defines.h:218
int s_soldash
solid/dashed line flag: 0 = solid, 1 = dashed
Definition defines.h:250
unsigned int s_dlist
display list index
Definition defines.h:231
int have_bbox
Definition defines.h:243
struct bv_scene_ob * parent
Definition defines.h:293
struct bu_vls s_name
object name (should be unique if view objects are to be addressed by name)
Definition defines.h:207
struct bu_list * vlfree
Definition defines.h:300
void * s_u_data
Definition defines.h:313
struct bv_scene_obj_old_settings s_old
Definition defines.h:287
struct bv_obj_settings * s_os
Definition defines.h:282
fastf_t sca
Definition defines.h:531
void * tra_m_udata
Definition defines.h:537
char origin_o
Definition defines.h:523
int tra_m_flag
Definition defines.h:536
int rot_m_flag
Definition defines.h:517
vect_t rot_v
Definition defines.h:526
vect_t tra_v_abs
Definition defines.h:558
vect_t tra_m_abs
Definition defines.h:555
vect_t rot_m_abs
Definition defines.h:544
vect_t rot_m
Definition defines.h:516
vect_t rot_o_abs_last
Definition defines.h:548
char origin_v
Definition defines.h:528
char origin_m
Definition defines.h:518
int rot_o_flag
Definition defines.h:522
fastf_t sca_abs
Definition defines.h:553
int rot_v_flag
Definition defines.h:527
void * rot_m_udata
Definition defines.h:519
vect_t rot_m_abs_last
Definition defines.h:545
vect_t tra_m_abs_last
Definition defines.h:556
vect_t tra_v
Definition defines.h:539
void * sca_udata
Definition defines.h:533
vect_t rot_v_abs
Definition defines.h:550
vect_t tra_v_abs_last
Definition defines.h:559
vect_t rot_o
Definition defines.h:521
int tra_v_flag
Definition defines.h:540
void * rot_o_udata
Definition defines.h:524
int sca_flag
Definition defines.h:532
vect_t rot_v_abs_last
Definition defines.h:551
vect_t tra_m
Definition defines.h:535
void * rot_v_udata
Definition defines.h:529
void * tra_v_udata
Definition defines.h:541
vect_t rot_o_abs
Definition defines.h:547
struct bv_scene_obj * free_scene_obj
Definition defines.h:503
struct bu_ptbl * db_objs
Definition defines.h:492
struct bu_ptbl * view_objs
Definition defines.h:494
struct bu_list gv_vlfree
Definition defines.h:500
struct bview_set_internal * i
Definition defines.h:676
struct bview_settings settings
Definition defines.h:677
size_t bot_threshold
Definition defines.h:445
struct bv_other_state gv_view_scale
Definition defines.h:459
struct bv_grid_state gv_grid
Definition defines.h:456
double gv_frametime
Definition defines.h:460
fastf_t curve_scale
Definition defines.h:446
int adaptive_plot_csg
Definition defines.h:444
fastf_t point_scale
Definition defines.h:447
int gv_snap_flags
Definition defines.h:436
struct bu_ptbl * gv_selected
Definition defines.h:477
int adaptive_plot_mesh
Definition defines.h:443
fastf_t lod_scale
Definition defines.h:449
struct bv_axes gv_model_axes
Definition defines.h:454
double gv_snap_tol_factor
Definition defines.h:434
struct bv_axes gv_view_axes
Definition defines.h:455
struct bv_interactive_rect_state gv_rect
Definition defines.h:472
int redraw_on_zoom
Definition defines.h:448
struct bv_adc_state gv_adc
Definition defines.h:471
struct bu_ptbl gv_snap_objs
Definition defines.h:435
struct bv_other_state gv_center_dot
Definition defines.h:457
int gv_snap_lines
Definition defines.h:433
struct bv_params_state gv_view_params
Definition defines.h:458
struct bv_data_tclcad gv_tcl
Definition defines.h:661
point_t gv_prev_point
Definition defines.h:610
fastf_t gv_size
2.0 * scale
Definition defines.h:573
int gv_height
Definition defines.h:587
struct bview_objs gv_objs
Definition defines.h:635
vect_t gv_aet
Definition defines.h:593
fastf_t gv_minMouseDelta
Definition defines.h:614
fastf_t gv_local2base
Definition defines.h:576
struct bu_vls gv_name
Definition defines.h:567
fastf_t gv_sscale
Definition defines.h:578
int gv_mouse_x
Definition defines.h:608
void * dmp
Definition defines.h:667
double radius
Definition defines.h:652
struct bview_settings * gv_s
shared settings supplied by user
Definition defines.h:618
mat_t gv_rotation
Definition defines.h:598
fastf_t gv_isize
1.0 / size
Definition defines.h:574
uint32_t magic
magic number
Definition defines.h:566
void(* gv_callback)(struct bview *, void *)
called in ged_view_update with gvp and gv_clientData
Definition defines.h:664
struct bview_settings gv_ls
locally maintained settings specific to view (used if gv_s is null)
Definition defines.h:619
fastf_t gv_perspective
perspective angle
Definition defines.h:592
fastf_t gv_prevMouseY
Definition defines.h:607
point2d_t gv_wmin
Definition defines.h:588
point2d_t gv_wmax
Definition defines.h:589
vect_t gv_lookat
Definition defines.h:651
point_t gv_point
Definition defines.h:611
mat_t gv_pmat
perspective matrix
Definition defines.h:603
mat_t gv_view2model
Definition defines.h:602
fastf_t gv_maxMouseDelta
Definition defines.h:615
char gv_coord
coordinate system
Definition defines.h:596
void(* gv_bounds_update)(struct bview *)
Definition defines.h:646
void * gv_clientData
passed to gv_callback
Definition defines.h:665
vect_t obb_extent1
Definition defines.h:643
struct bu_ptbl * callbacks
Definition defines.h:666
vect_t obb_extent3
Definition defines.h:645
fastf_t gv_base2local
Definition defines.h:575
int gv_mouse_y
Definition defines.h:609
struct bview_knobs k
Definition defines.h:655
point_t obb_center
Definition defines.h:642
fastf_t gv_i_scale
Definition defines.h:570
vect_t obb_extent2
Definition defines.h:644
point_t gv_vc_backout
Definition defines.h:650
fastf_t gv_scale
Definition defines.h:572
struct bview_set * vset
Definition defines.h:629
unsigned long gv_mod_flags
Definition defines.h:613
mat_t gv_model2view
Definition defines.h:600
char gv_key
Definition defines.h:612
fastf_t gv_rscale
Definition defines.h:577
void * u_data
Definition defines.h:668
fastf_t gv_prevMouseX
Definition defines.h:606
fastf_t gv_a_scale
absolute scale
Definition defines.h:571
point_t orig_pos
Definition defines.h:658
int independent
Definition defines.h:625
char gv_rotate_about
indicates what point rotations are about
Definition defines.h:597
vect_t gv_keypoint
Definition defines.h:595
mat_t gv_center
Definition defines.h:599
vect_t gv_eye_pos
eye position
Definition defines.h:594
int gv_width
Definition defines.h:586
mat_t gv_pmodel2view
Definition defines.h:601
fundamental vector, matrix, quaternion math macros