BRL-CAD
tcl_data.h
Go to the documentation of this file.
1 /* B V I E W / T C L _ D A T A . 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_tcl
21  *
22  * We're retaining these for libtclcad - don't use elsewhere
23  */
24 #ifndef DM_BV_TCL_DATA_H
25 #define DM_BV_TCL_DATA_H
26 
27 #include "common.h"
28 #include "bu/list.h"
29 #include "bu/vls.h"
30 #include "bu/ptbl.h"
31 #include "bg/polygon_types.h"
32 #include "bv/faceplate.h"
33 #include "vmath.h"
34 
35 /** @{ */
36 /** @file bv/tcl_data.h */
37 
38 #define BV_POLY_CIRCLE_MODE 15
39 #define BV_POLY_CONTOUR_MODE 16
40 
41 // Separate these out, as we'll try not to use them in the new display work
43  char s_wflag; /**< @brief work flag - used by various libged and Tcl functions */
44  char s_dflag; /**< @brief 1 - s_basecolor is derived from the default */
45  unsigned char s_basecolor[3]; /**< @brief color from containing region */
46  char s_uflag; /**< @brief 1 - the user specified the color */
47  char s_cflag; /**< @brief 1 - use the default color */
48 
49  /* Database object related info */
50  char s_Eflag; /**< @brief flag - not a solid but an "E'd" region (MGED ONLY)*/
51  short s_regionid; /**< @brief region ID (MGED ONLY)*/
52 };
53 
54 /* A display list corresponds (typically) to a database object. It is composed of one
55  * or more scene objects, which can be manipulated independently but collectively make
56  * up the displayed representation of an object. */
57 struct display_list {
58  struct bu_list l;
59  void *dl_dp; /* Normally this will be a struct directory pointer */
60  struct bu_vls dl_path;
61  struct bu_list dl_head_scene_obj; /**< @brief head of scene obj list for this display list */
62  int dl_wflag;
63 };
64 
66  int draw;
67  int color[3];
68  int line_width; /* in pixels */
69  fastf_t size; /* in view coordinates */
71  point_t *points; /* in model coordinates */
72 };
73 
75  int gdas_draw;
76  int gdas_color[3];
77  int gdas_line_width; /* in pixels */
81  point_t *gdas_points; /* in model coordinates */
82 };
83 
85  int gdls_draw;
86  int gdls_color[3];
88  int gdls_size;
89  char **gdls_labels;
91 };
92 
94  int gdls_draw;
95  int gdls_color[3];
96  int gdls_line_width; /* in pixels */
98  point_t *gdls_points; /* in model coordinates */
99 };
100 
101 typedef struct {
104  int gdps_color[3];
105  int gdps_line_width; /* in pixels */
107  int gdps_cflag; /* contour flag */
118  struct bg_polygons gdps_polygons;
121 
122 
123 /* A note about the vZ parameter...
124  *
125  * gv_data_vZ is an internal parameter used by commands creating and
126  * manipulating data objects. Geometrically, it is a magnitude in the
127  * direction of the Z vector of the view plane. Functionally, what it
128  * allows the code to do is define a 2D plane embedded in in 3D space that
129  * is offset from but parallel to the view plane - in an orthogonal view
130  * this corresponds to objects drawn in that plane being "above" or "below"
131  * objects defined within the view plane itself.
132  *
133  * Visually, objects drawn in this fashion in orthogonal views will be
134  * indistinguishable regardless of their vZ offset - it is only when the
135  * view is rotated that the user will be able to see the "above" and
136  * "below" effect of creating view objects with differing vZ values.
137  *
138  * Users will generally not want to set gv_data_vZ directly, as it is a view
139  * space value and may not behave intuitively. Commands are defined to
140  * calculate vZ values based on model spaces inputs, and these should be
141  * used to generate the value supplied to gv_data_vZ.
142  */
144  int gv_polygon_mode; // libtclcad polygon modes
145  int gv_hide; // libtclcad setting for hiding view - unused?
158 };
159 
160 #endif /* DM_BV_TCL_DATA_H */
161 
162 /** @} */
163 /*
164  * Local Variables:
165  * mode: C
166  * tab-width: 8
167  * indent-tabs-mode: t
168  * c-file-style: "stroustrup"
169  * End:
170  * ex: shiftwidth=4 tabstop=8
171  */
Header file for the BRL-CAD common definitions.
bg_clip_t
Functions for working with polygons.
Definition: polygon_types.h:40
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 point_t[ELEMENTS_PER_POINT]
3-tuple point
Definition: vmath.h:355
Definition: list.h:132
Definition: vls.h:53
point_t * gdas_points
Definition: tcl_data.h:81
point_t * points
Definition: tcl_data.h:71
point_t * gdls_points
Definition: tcl_data.h:90
char ** gdls_labels
Definition: tcl_data.h:89
int gdls_color[3]
Definition: tcl_data.h:95
point_t * gdls_points
Definition: tcl_data.h:98
size_t gdps_curr_point_i
Definition: tcl_data.h:110
size_t gdps_curr_polygon_i
Definition: tcl_data.h:109
point_t gdps_prev_point
Definition: tcl_data.h:111
size_t gdps_target_polygon_i
Definition: tcl_data.h:108
bg_clip_t gdps_clip_type
Definition: tcl_data.h:112
struct bv_other_state gv_prim_labels
Definition: tcl_data.h:157
struct bv_data_arrow_state gv_sdata_arrows
Definition: tcl_data.h:152
struct bv_data_axes_state gv_sdata_axes
Definition: tcl_data.h:153
bv_data_polygon_state gv_data_polygons
Definition: tcl_data.h:151
struct bv_data_line_state gv_data_lines
Definition: tcl_data.h:150
struct bv_data_line_state gv_sdata_lines
Definition: tcl_data.h:155
struct bv_data_axes_state gv_data_axes
Definition: tcl_data.h:148
struct bv_data_label_state gv_sdata_labels
Definition: tcl_data.h:154
bv_data_polygon_state gv_sdata_polygons
Definition: tcl_data.h:156
struct bv_data_label_state gv_data_labels
Definition: tcl_data.h:149
fastf_t gv_data_vZ
Definition: tcl_data.h:146
struct bv_data_arrow_state gv_data_arrows
Definition: tcl_data.h:147
int gv_polygon_mode
Definition: tcl_data.h:144
char s_wflag
work flag - used by various libged and Tcl functions
Definition: tcl_data.h:43
char s_cflag
1 - use the default color
Definition: tcl_data.h:47
unsigned char s_basecolor[3]
color from containing region
Definition: tcl_data.h:45
char s_Eflag
flag - not a solid but an "E'd" region (MGED ONLY)
Definition: tcl_data.h:50
short s_regionid
region ID (MGED ONLY)
Definition: tcl_data.h:51
char s_uflag
1 - the user specified the color
Definition: tcl_data.h:46
char s_dflag
1 - s_basecolor is derived from the default
Definition: tcl_data.h:44
int dl_wflag
Definition: tcl_data.h:62
struct bu_list dl_head_scene_obj
head of scene obj list for this display list
Definition: tcl_data.h:61
void * dl_dp
Definition: tcl_data.h:59
struct bu_list l
Definition: tcl_data.h:58
struct bu_vls dl_path
Definition: tcl_data.h:60
fundamental vector, matrix, quaternion math macros