Debian Codegraph @

packages/seacas/libraries/svdi/cgi/data_def.h

raw
1 /*
2 * Copyright(C) 1999-2020, 2022 National Technology & Engineering Solutions
3 * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 * NTESS, the U.S. Government retains certain rights in this software.
5 *
6 * See packages/seacas/LICENSE for details
7 */
8 #pragma once
9 /* ------------------------------------------------------------*/
10 /* >> DATA STRUCTURE DEFINITIONS */
11 /*-------------------------------------------------------------*/
12
13 #include "cgi.h"
14
15 /* define a structure to store SVDI attributes */
16 /* --keeps track of SVDI attribs which have been set for each surface */
17 /* --these values are stored in CGI terms, not SVDI/NDC terms */
18 typedef struct
19 {
20 int fg_color; /* foreground color for vector */
21 int bg_color; /* background color for vector */
22 float intensity; /* current intensity */
23 int line_type; /* current line style */
24 float line_width; /* current line width */
25 float char_x; /* current char box size in x */
26 float char_y; /* current char box size in y */
27 float fg_rgb[3]; /* foreground color for raster */
28 float bg_rgb[3]; /* background color for raster */
29 } vdi_attrib_struct;
30
31 /* state list structure for this device */
32 /* -- stores state of each surface for this device */
33 typedef struct
34 {
35
36 /* cstate.i - definitions for cgi part of state lists for devices
37 * 8 Sep 1989 - last date modified
38 * Pat McGee, [email protected]
39 */
40
41 int cgi_inited; /* 0 for uninitialized, 1 for inited */
42 int err_flag[MAX_ERROR_CLASS]; /* on or off for each of 7 classes */
43 error_report err_queue[ERROR_LIST_SIZE];
44 int err_head_ptr; /* head of error queue */
45 int err_count; /* count of errors in queue */
46
47 /* ----------control, negotiation and errors---------- */
48 /* control state list */
49 /* -- control state: */
50 int pic_dirty; /* 0 = clean, 1 = dirty */
51 int color_index_prec; /* -1 for bad */
52
53 /* -- VDC to Device mapping: */
54 point vdc1; /* corner 1 of vdc extent */
55 point vdc2; /* corner 2 of vdc extent */
56 point vp1; /* corner 1 of viewport (mode:fraction view surf)*/
57 point vp2; /* corner 1 of viewport (mode:fraction view surf)*/
58 point eff_vp1; /* corner 1 of effective viewport */
59 point eff_vp2; /* corner 2 of effective viewport */
60
61 /* -- clipping: */
62 cenum clip_indicator; /* on, off */
63 point clip_rect1; /* corner 1 of requested clip rectangle */
64 point clip_rect2; /* corner 2 of requested clip rectangle */
65 cenum ds_clip_indicator; /* off, draw surf clip rect, viewport */
66
67 /* ----------output and attributes---------- */
68 /* attribute state lists */
69 /* line attributes state list */
70 int line_type;
71 float line_width;
72 int line_color[3]; /* use elem 0 for indexed, all 3 for direct*/
73 cenum line_csm; /* csm in which line color was last specified */
74
75 /* marker attributes state list */
76 int mark_type;
77 float mark_size;
78 int mark_color[3]; /* use elem 0 for indexed, all 3 for direct*/
79 cenum mark_csm; /* csm in which mark color was last specified */
80
81 /* text attributes state list */
82 int text_color[3]; /* use elem 0 for indexed, all 3 for direct*/
83 cenum text_csm; /* csm in which text color was last specified */
84 float char_height;
85
86 /* fill attributes state list */
87 int fill_color[3]; /* use elem 0 for indexed, all 3 for direct*/
88 cenum fill_csm; /* csm in which fill color was last specified */
89 int interior_style; /* 0 = hollow, 1 = solid */
90
91 /* output and attribute control state list */
92 cenum csm; /* current color mode:
93 0=direct, 1=indexed, -1=bad*/
94 rgb color_table[COLOR_TABLE_SIZE];
95
96 /* end cstate.i */
97
98 int next_free_state; /* for free state list */
99 int this_index; /* index of statelist in array */
100
101 /* SVDI dependent stuff */
102 float xscale; /* x scale to map VDC to NDC viewport */
103 float yscale; /* y scale to map VDC to NDC viewport */
104 float xoffset; /* x offset to map VDC to NDC v.p. */
105 float yoffset; /* y offset to map VDC to NDC v.p. */
106 int color_set; /* TRUE = color table set by user */
107 vdi_attrib_struct vdi_attrib; /* current vdi attributes */
108
109 /* other info */
110 point eff_clip_rect1; /* corner 1 of effective clip rectangle */
111 point eff_clip_rect2; /* corner 2 of effective clip rectangle */
112 point clipmin; /* min corner of actual clip region - NDC */
113 point clipmax; /* max corner of actual clip region - NDC */
114 int clip_on; /* logical - TRUE = clipping is on */
115 int fg_index; /* for mapping foreground and background */
116 int bg_index; /* indices */
117
118 /* device dependent stuff - batch device */
119 /* -- BUFFER_SIZE is 0 if interactive device */
120 char filename[100]; /* name of file */
121 int file_d; /* file descriptor - -1 if file not open */
122 char buffer[BUFFER_SIZE]; /* for buffering data for output to file */
123 int buff_ptr; /* keep track of buffer space */
124
125 /* device dependent stuff - interactive device */
126 /* a state list exists for each logical input device as identified
127 * by its input class and its input device index. we support only
128 * locator, and 1 input device index.
129 */
130 int input_dev_class; /* we only support locator */
131 int input_dev_index; /* we only support 1 */
132 cenum input_dev_state; /* ready or released */
133
134 } surf_statelist;
135
136 /* description table */
137 /* -- stores description table for this device - one per device */
138 typedef struct
139 {
140
141 /* cdescr.i - definitions for cgi description table */
142 /* 9 Sep 1989 - last date modified
143 */
144
145 /* ----------control, negotiation and errors---------- */
146 /* device identity description table */
147 cenum dev_class; /* device class: IN,OUT,INOUT */
148 char dev_id[4]; /* device identification */
149
150 /* output device description table */
151 cenum copy_class; /* hard, soft */
152 cenum display_type; /* vector,raster,other */
153 cenum bcolor_cap; /* background color capability */
154 cenum dynamic_mod_bg; /* dynamic mod accept for bg color */
155 cenum dynamic_mod_map; /* dynamic mod accept for mapping */
156 dpoint dc1; /* device bottom left corner */
157 dpoint dc2; /* device upper right corner */
158 float draw_surf_width; /* measured in millimeters */
159 float draw_surf_height; /* measured in millimeters */
160 cenum pix_loc; /* pixel location */
161
162 /* ----------output and attributes---------- */
163 /* attribute description tables */
164 /* primitive support description table */
165 int max_pts_polyline; /* -1,128..n */
166 int max_pts_disj_polyline; /* -1,0..n */
167 int max_pts_polygon; /* -1,0..n */
168 int max_pts_polygon_set; /* -1,0..n */
169 int max_pts_polymarker; /* -1,128..n */
170 int max_pts_cellarray; /* -1,0..n */
171 int max_pts_closed_fig; /* -1,0..n */
172 int max_chars_text; /* 80..n */
173 cenum cellarray_fill_cap; /* none,global,local */
174 cenum cellarray_align_cap; /* axis,skewed */
175 cenum compound_text_cap; /* none,global,local */
176 cenum compound_fig_cap; /* none,global,local */
177
178 /* line description table */
179 int linewidth_nominal; /* nominal scaled line width ( >0 ) */
180 int linewidth_min; /* minimum scaled line width ( >0 ) */
181 int linewidth_max; /* maximum scaled line width ( >0 ) */
182 int line_types[5]; /* list of available line types */
183 int line_widths[5]; /* list of available scale line widths */
184
185 /* marker description table */
186 int mark_nominal; /* nominal scaled marker size ( >0 ) */
187 int mark_min; /* minimum scaled marker size ( >0 ) */
188 int mark_max; /* maximum scaled marker size ( >0 ) */
189 int mark_types[1]; /* list of available marker types */
190 int mark_sizes[1]; /* list of available scale marker sizes */
191
192 /* text description table */
193 /* fill description table */
194 cenum interior_styles[2]; /* list of available interior styles */
195
196 /* attribute and control description table */
197 int num_simul_colors; /* 2..n */
198 int num_avail_colors; /* 2..n */
199 int num_avail_int; /* if direct, use all 3 */
200 cenum csm_avail; /* indexed only, indexed and direct */
201 cenum dynamic_mod_ct; /* irg, cbs, imm */
202 cenum color_overwrite; /* irg, cbs, imm */
203 cenum monochrome_device; /* no,yes */
204
205 /* end cdescr.i */
206
207 /* SVDI part of description table */
208 /* --used to store default SVDI setup and to reinitialize */
209 int set_flag; /* TRUE = SVDI defaults set, FALSE = not */
210 int svdi_type; /* 0 = SVDI, 1 = SVDI+raster */
211 float xndc_max; /* max x ndc value */
212 float yndc_max; /* max y ndc value */
213 float att_array[14]; /* output status of attributes */
214 /* --stuff stored in CGI terms */
215 int num_cols; /* number of colors */
216 int col_mode; /* color mode */
217 int index_array[256]; /* color index array */
218 float color_array[256][3]; /* color values */
219
220 } dev_descrip_table;