BRL-CAD
bview.h
Go to the documentation of this file.
1 /* B V I E W . H
2  * BRL-CAD
3  *
4  * Copyright (c) 1993-2014 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 /** @{ */
21 /** @file bview.h
22  *
23  * Types and definitions related to display lists, angle distance cursor,
24  * and other generic view constructs. This header is intended to be
25  * independent of any one BRL-CAD library and is specifically intended
26  * to allow the easy definition of common display list types between
27  * otherwise independent libraries (libdm and libged, for example).
28  */
29 
30 #ifndef BVIEW_H
31 #define BVIEW_H
32 
33 #include "common.h"
34 #include "bu/list.h"
35 #include "bu/vls.h"
36 #include "vmath.h"
37 
38 #ifndef UP
39 # define UP 0
40 #endif
41 #ifndef DOWN
42 # define DOWN 1
43 #endif
44 
45 struct display_list {
46  struct bu_list l;
47  void *dl_dp; /* Normally this will be a struct directory pointer */
48  struct bu_vls dl_path;
49  struct bu_list dl_headSolid; /**< @brief head of solid list for this object */
50  int dl_wflag;
51 };
52 
54  int draw;
55  int dv_x;
56  int dv_y;
57  int dv_a1;
58  int dv_a2;
59  int dv_dist;
67  int anchor_a1;
68  int anchor_a2;
73  int line_color[3];
74  int tick_color[3];
76 };
77 
79  int draw;
80  point_t axes_pos; /* in model coordinates */
81  fastf_t axes_size; /* in view coordinates */
82  int line_width; /* in pixels */
83  int pos_only;
84  int axes_color[3];
85  int label_color[3];
88  int tick_length; /* in pixels */
89  int tick_major_length; /* in pixels */
90  fastf_t tick_interval; /* in mm */
93  int tick_color[3];
95 };
96 
98  int draw;
99  int color[3];
100  int line_width; /* in pixels */
101  fastf_t size; /* in view coordinates */
103  point_t *points; /* in model coordinates */
104 };
105 
107  int draw; /* draw grid */
108  int snap; /* snap to grid */
110  fastf_t res_h; /* grid resolution in h */
111  fastf_t res_v; /* grid resolution in v */
112  int res_major_h; /* major grid resolution in h */
113  int res_major_v; /* major grid resolution in v */
114  int color[3];
115 };
116 
118  int active; /* 1 - actively drawing a rectangle */
119  int draw; /* draw rubber band rectangle */
121  int line_style; /* 0 - solid, 1 - dashed */
122  int pos[2]; /* Position in image coordinates */
123  int dim[2]; /* Rectangle dimension in image coordinates */
124  fastf_t x; /* Corner of rectangle in normalized */
125  fastf_t y; /* ------ view coordinates (i.e. +-1.0). */
126  fastf_t width; /* Width and height of rectangle in */
127  fastf_t height; /* ------ normalized view coordinates. */
128  int bg[3]; /* Background color */
129  int color[3]; /* Rectangle color */
130  int cdim[2]; /* Canvas dimension in pixels */
131  fastf_t aspect; /* Canvas aspect ratio */
132 };
133 
134 
137  int gdas_color[3];
138  int gdas_line_width; /* in pixels */
142  point_t *gdas_points; /* in model coordinates */
143 };
144 
147  int gdls_color[3];
150  char **gdls_labels;
151  point_t *gdls_points;
152 };
153 
156  int gdls_color[3];
157  int gdls_line_width; /* in pixels */
159  point_t *gdls_points; /* in model coordinates */
160 };
161 
163 
164 typedef struct {
166  point_t *gpc_point; /* in model coordinates */
168 
169 typedef struct {
171  int gp_color[3];
172  int gp_line_width; /* in pixels */
174  int *gp_hole;
176 } bview_polygon;
177 
178 typedef struct {
182 
183 typedef struct {
185  int gdps_color[3];
186  int gdps_line_width; /* in pixels */
188  int gdps_cflag; /* contour flag */
195  point_t gdps_origin;
202 
204  int gos_draw;
207 };
208 
209 struct bview {
210  struct bu_list l;
212  fastf_t gv_size; /**< @brief 2.0 * scale */
213  fastf_t gv_isize; /**< @brief 1.0 / size */
214  fastf_t gv_perspective; /**< @brief perspective angle */
215  vect_t gv_aet;
216  vect_t gv_eye_pos; /**< @brief eye position */
217  vect_t gv_keypoint;
218  char gv_coord; /**< @brief coordinate system */
219  char gv_rotate_about; /**< @brief indicates what point rotations are about */
220  mat_t gv_rotation;
221  mat_t gv_center;
225  mat_t gv_pmat; /**< @brief perspective matrix */
226  void (*gv_callback)(); /**< @brief called in ged_view_update with gvp and gv_clientData */
227  void * gv_clientData; /**< @brief passed to gv_callback */
234  int gv_mode;
235  int gv_zclip;
262 };
263 
264 
271  int dmode;
273  void *freesolid;
274 };
275 
276 
277 #endif /* BVIEW_H */
278 
279 /** @} */
280 /*
281  * Local Variables:
282  * mode: C
283  * tab-width: 8
284  * indent-tabs-mode: t
285  * c-file-style: "stroustrup"
286  * End:
287  * ex: shiftwidth=4 tabstop=8
288  */
struct bu_list l
Definition: bview.h:46
ClipType gdps_clip_type
Definition: bview.h:193
int color[3]
Definition: bview.h:114
size_t gdps_curr_polygon_i
Definition: bview.h:190
mat_t gv_pmat
perspective matrix
Definition: bview.h:225
mat_t gv_center
Definition: bview.h:221
fastf_t gv_data_vZ
Definition: bview.h:261
struct bu_list dl_headSolid
head of solid list for this object
Definition: bview.h:49
int res_major_v
Definition: bview.h:113
int anchor_a1
Definition: bview.h:67
fastf_t axes_size
Definition: bview.h:81
fastf_t gv_curve_scale
Definition: bview.h:260
struct bview_other_state gv_view_scale
Definition: bview.h:253
size_t gp_num_contours
Definition: bview.h:170
Definition: list.h:118
void(* gv_callback)()
called in ged_view_update with gvp and gv_clientData
Definition: bview.h:226
point_t * gpc_point
Definition: bview.h:166
int ticks_per_major
Definition: bview.h:91
struct display_list * gdlp
Definition: bview.h:266
void * gv_clientData
passed to gv_callback
Definition: bview.h:227
struct bview_data_axes_state gv_sdata_axes
Definition: bview.h:245
int tick_threshold
Definition: bview.h:92
fastf_t a2
Definition: bview.h:64
fastf_t tick_interval
Definition: bview.h:90
vect_t gv_keypoint
Definition: bview.h:217
struct bview_axes_state gv_model_axes
Definition: bview.h:237
void * freesolid
Definition: bview.h:273
mat_t gv_pmodel2view
Definition: bview.h:223
int tick_length
Definition: bview.h:88
int draw_solid_lines_only
Definition: bview.h:267
size_t gp_num_polygons
Definition: bview.h:179
fastf_t anchor[3]
Definition: bview.h:109
int gos_line_color[3]
Definition: bview.h:205
int gos_text_color[3]
Definition: bview.h:206
int axes_color[3]
Definition: bview.h:84
struct bview_other_state gv_prim_labels
Definition: bview.h:251
Definition: bview.h:209
Header file for the BRL-CAD common definitions.
fastf_t gv_perspective
perspective angle
Definition: bview.h:214
void * dl_dp
Definition: bview.h:47
int line_width
Definition: bview.h:82
struct bview_data_line_state gv_sdata_lines
Definition: bview.h:247
int wireframe_color_override
Definition: bview.h:268
int dv_dist
Definition: bview.h:59
bview_polygons gdps_polygons
Definition: bview.h:199
int anchor_pos
Definition: bview.h:66
char ** gdls_labels
Definition: bview.h:150
struct bview_interactive_rect_state gv_rect
Definition: bview.h:254
fastf_t pos_grid[3]
Definition: bview.h:62
int res_major_h
Definition: bview.h:112
struct bview_data_label_state gv_sdata_labels
Definition: bview.h:246
struct bview_data_axes_state gv_data_axes
Definition: bview.h:240
size_t gpc_num_points
Definition: bview.h:165
fastf_t gv_minMouseDelta
Definition: bview.h:230
int tick_major_length
Definition: bview.h:89
fastf_t gv_sscale
Definition: bview.h:233
fastf_t a1
Definition: bview.h:63
mat_t gv_view2model
Definition: bview.h:224
size_t gdps_curr_point_i
Definition: bview.h:191
int gv_y_samples
Definition: bview.h:258
fastf_t anchor_pt_a1[3]
Definition: bview.h:70
int gp_line_style
Definition: bview.h:173
bview_poly_contour * gp_contour
Definition: bview.h:175
int label_color[3]
Definition: bview.h:85
struct bu_list l
Definition: bview.h:210
int tick_major_color[3]
Definition: bview.h:94
fastf_t res_h
Definition: bview.h:110
fastf_t gv_isize
1.0 / size
Definition: bview.h:213
struct bview_grid_state gv_grid
Definition: bview.h:249
struct bview_other_state gv_center_dot
Definition: bview.h:250
point_t * gdls_points
Definition: bview.h:151
point_t * points
Definition: bview.h:103
fastf_t gv_scale
Definition: bview.h:211
int wireframe_color[3]
Definition: bview.h:269
struct bview_data_label_state gv_data_labels
Definition: bview.h:241
fastf_t gv_size
2.0 * scale
Definition: bview.h:212
fastf_t res_v
Definition: bview.h:111
int * gp_hole
Definition: bview.h:174
fastf_t anchor_pt_dst[3]
Definition: bview.h:72
char gv_rotate_about
indicates what point rotations are about
Definition: bview.h:219
fastf_t dst
Definition: bview.h:65
int gp_line_width
Definition: bview.h:172
bview_polygon * gp_polygon
Definition: bview.h:180
point_t * gdls_points
Definition: bview.h:159
int tick_color[3]
Definition: bview.h:74
int line_width
Definition: bview.h:75
int dl_wflag
Definition: bview.h:50
int gv_adaptive_plot
Definition: bview.h:255
int line_color[3]
Definition: bview.h:73
Definition: bview.h:162
struct bview_adc_state gv_adc
Definition: bview.h:236
struct bu_vls dl_path
Definition: bview.h:48
point_t axes_pos
Definition: bview.h:80
int gv_redraw_on_zoom
Definition: bview.h:256
int triple_color
Definition: bview.h:86
fastf_t gv_rscale
Definition: bview.h:232
int tick_color[3]
Definition: bview.h:93
int gv_x_samples
Definition: bview.h:257
int tick_enabled
Definition: bview.h:87
int gv_mode
Definition: bview.h:234
fastf_t gv_maxMouseDelta
Definition: bview.h:231
point_t * gdas_points
Definition: bview.h:142
fastf_t anchor_pt_a2[3]
Definition: bview.h:71
mat_t gv_rotation
Definition: bview.h:220
fastf_t pos_view[3]
Definition: bview.h:61
mat_t gv_model2view
Definition: bview.h:222
bview_data_polygon_state gv_sdata_polygons
Definition: bview.h:248
struct bview_data_arrow_state gv_sdata_arrows
Definition: bview.h:244
char gv_coord
coordinate system
Definition: bview.h:218
ClipType
Definition: bview.h:162
struct bview_axes_state gv_view_axes
Definition: bview.h:238
int pos_only
Definition: bview.h:83
vect_t gv_eye_pos
eye position
Definition: bview.h:216
struct bview_data_arrow_state gv_data_arrows
Definition: bview.h:239
bview_data_polygon_state gv_data_polygons
Definition: bview.h:243
vect_t gv_aet
Definition: bview.h:215
struct bview_data_line_state gv_data_lines
Definition: bview.h:242
size_t gdps_target_polygon_i
Definition: bview.h:189
int transparency
Definition: bview.h:270
int gv_zclip
Definition: bview.h:235
fastf_t pos_model[3]
Definition: bview.h:60
fastf_t gv_prevMouseX
Definition: bview.h:228
point_t gdps_prev_point
Definition: bview.h:192
Definition: vls.h:56
int anchor_dst
Definition: bview.h:69
double fastf_t
Definition: defines.h:300
fastf_t gv_prevMouseY
Definition: bview.h:229
struct bview_other_state gv_view_params
Definition: bview.h:252
int anchor_a2
Definition: bview.h:68
fastf_t gv_point_scale
Definition: bview.h:259