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