7fd59977 |
1 | /*********************************************************************** |
2 | |
3 | FONCTION : |
4 | ---------- |
5 | File OpenGl_facecontextgroup : |
6 | |
7 | |
8 | REMARQUES: |
9 | ---------- |
10 | |
11 | HISTORIQUE DES MODIFICATIONS : |
12 | -------------------------------- |
13 | xx-xx-xx : xxx ; Creation. |
14 | 03-09-97 : FMN ; Ajout traitement Begin/EndPrimitives() |
15 | 05-08-97 : PCT ; ajout texture mapping |
16 | 23-12-97 : FMN ; Suppression TelBackInteriorStyle, TelBackInteriorStyleIndex |
17 | 30-12-97 : FMN ; CTS18312: Correction back material |
18 | 15-01-98 : FMN ; Ajout Hidden line |
19 | 03-03-98 : CAL ; Modification des structures CALL_DEF_GROUP et STRUCTURE |
20 | 08-04-98 : FGU ; Ajout emission |
21 | 22-03-04 : SAN ; OCC4895 High-level interface for controlling polygon offsets |
22 | |
23 | ************************************************************************/ |
24 | |
25 | #define OCC1174 /* SAV 08/01/03 : Added back face interior color management */ |
26 | |
27 | /*----------------------------------------------------------------------*/ |
28 | /* |
29 | * Includes |
30 | */ |
31 | |
32 | #include <OpenGl_tgl_all.hxx> |
33 | #include <InterfaceGraphic_Graphic3d.hxx> |
34 | #include <OpenGl_context.hxx> |
35 | #include <OpenGl_tgl.hxx> |
36 | #include <OpenGl_tgl_funcs.hxx> |
37 | #include <OpenGl_tgl_subrs.hxx> |
38 | #include <OpenGl_tgl_utilgr.hxx> |
39 | |
40 | /*----------------------------------------------------------------------*/ |
41 | |
42 | void EXPORT |
43 | call_togl_facecontextgroup |
44 | ( |
45 | CALL_DEF_GROUP * agroup, |
46 | int noinsert |
47 | ) |
48 | { |
49 | /* for the group */ |
50 | Tfloat liner, lineg, lineb; |
51 | Tint linetype=0; |
52 | Tfloat linewidth; |
53 | Tfloat fillr, fillg, fillb; |
54 | #ifdef OCC1174 |
55 | Tfloat fillBackr, fillBackg, fillBackb; |
56 | #endif |
57 | Tint intstyle=0; |
58 | Tint hatch=0; |
59 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
60 | Tint polyOffsetMode; |
61 | Tfloat polyOffsetFactor, polyOffsetUnits; |
62 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
63 | |
64 | /* for the structure */ |
65 | Tfloat Liner, Lineg, Lineb; |
66 | Tint Linetype=0; |
67 | Tfloat Linewidth; |
68 | Tfloat Fillr, Fillg, Fillb; |
69 | #ifdef OCC1174 |
70 | Tfloat FillBackr, FillBackg, FillBackb; |
71 | #endif |
72 | Tint Intstyle=0; |
73 | Tint Hatch=0; |
74 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
75 | Tint PolyOffsetMode; |
76 | Tfloat PolyOffsetFactor, PolyOffsetUnits; |
77 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
78 | |
79 | /* Flag sur les composants lumineux du materiel */ |
80 | Tint lightbool = 0x0; |
81 | |
82 | /* |
83 | * Si le groupe est ouvert cela signifie que BeginPrimitives |
84 | * a ete utilise. |
85 | * Dans le cas des markers composes, il faut refermer temporairement |
86 | * le groupe pour eviter des insertions d'attributs aleatoires. |
87 | */ |
88 | if (agroup->IsOpen) call_togl_closegroup (agroup); |
89 | |
90 | if( agroup->ContextFillArea.IsDef ) |
91 | { |
92 | /* recuperation du contexte du group */ |
93 | /* pour les primitives fill area */ |
94 | |
95 | switch( agroup->ContextFillArea.Style ) |
96 | { |
97 | case 0 : /* Aspect_IS_EMPTY */ |
98 | intstyle = CALL_PHIGS_STYLE_EMPTY; |
99 | break; |
100 | case 1 : /* Aspect_IS_HOLLOW */ |
101 | intstyle = CALL_PHIGS_STYLE_HOLLOW; |
102 | break; |
103 | case 2 : /* Aspect_IS_HATCH */ |
104 | intstyle = CALL_PHIGS_STYLE_HATCH; |
105 | break; |
106 | case 3 : /* Aspect_IS_SOLID */ |
107 | intstyle = CALL_PHIGS_STYLE_SOLID; |
108 | break; |
109 | case 4 : /* Aspect_IS_HIDDENLINE */ |
110 | intstyle = CALL_PHIGS_STYLE_HIDDENLINE; |
111 | break; |
112 | default : |
113 | break; |
114 | } |
115 | |
116 | switch( agroup->ContextFillArea.Hatch ) |
117 | { |
118 | case 0 : /* Aspect_HS_HORIZONTAL */ |
119 | hatch = CALL_PHIGS_HATCH_HORIZ; |
120 | break; |
121 | case 1 : /* Aspect_HS_HORIZONTAL_WIDE */ |
122 | hatch = CALL_PHIGS_HATCH_HORIZ_DBL; |
123 | break; |
124 | case 2 : /* Aspect_HS_VERTICAL */ |
125 | hatch = CALL_PHIGS_HATCH_VERT; |
126 | break; |
127 | case 3 : /* Aspect_HS_VERTICAL_WIDE */ |
128 | hatch = CALL_PHIGS_HATCH_VERT_DBL; |
129 | break; |
130 | case 4 : /* Aspect_HS_DIAGONAL_45 */ |
131 | hatch = CALL_PHIGS_HATCH_DIAG_45; |
132 | break; |
133 | case 5 : /* Aspect_HS_DIAGONAL_45_WIDE */ |
134 | hatch = CALL_PHIGS_HATCH_DIAG_45_DBL; |
135 | break; |
136 | case 6 : /* Aspect_HS_DIAGONAL_135 */ |
137 | hatch = CALL_PHIGS_HATCH_DIAG_135; |
138 | break; |
139 | case 7 : /* Aspect_HS_DIAGONAL_135_WIDE */ |
140 | hatch = CALL_PHIGS_HATCH_DIAG_135_DBL; |
141 | break; |
142 | case 8 : /* Aspect_HS_GRID */ |
143 | hatch = CALL_PHIGS_HATCH_GRID_R; |
144 | break; |
145 | case 9 : /* Aspect_HS_GRID_WIDE */ |
146 | hatch = CALL_PHIGS_HATCH_GRID_R_DBL; |
147 | break; |
148 | case 10 : /* Aspect_HS_GRID_DIAGONAL */ |
149 | hatch = CALL_PHIGS_HATCH_GRID_D; |
150 | break; |
151 | case 11 : /* Aspect_HS_GRID_DIAGONAL_WIDE */ |
152 | hatch = CALL_PHIGS_HATCH_GRID_D_DBL; |
153 | break; |
154 | default : |
155 | break; |
156 | } |
157 | |
158 | fillr = agroup->ContextFillArea.IntColor.r; |
159 | fillg = agroup->ContextFillArea.IntColor.g; |
160 | fillb = agroup->ContextFillArea.IntColor.b; |
161 | |
162 | #ifdef OCC1174 |
163 | fillBackr = agroup->ContextFillArea.BackIntColor.r; |
164 | fillBackg = agroup->ContextFillArea.BackIntColor.g; |
165 | fillBackb = agroup->ContextFillArea.BackIntColor.b; |
166 | #endif |
167 | |
168 | liner = agroup->ContextFillArea.EdgeColor.r; |
169 | lineg = agroup->ContextFillArea.EdgeColor.g; |
170 | lineb = agroup->ContextFillArea.EdgeColor.b; |
171 | |
172 | switch( agroup->ContextFillArea.LineType ) |
173 | { |
174 | case 0 : /* Aspect_TOL_SOLID */ |
175 | linetype = CALL_PHIGS_LINE_SOLID; |
176 | break; |
177 | case 1 : /* Aspect_DASH */ |
178 | linetype = CALL_PHIGS_LINE_DASH; |
179 | break; |
180 | case 2 : /* Aspect_TOL_DOT */ |
181 | linetype = CALL_PHIGS_LINE_DOT; |
182 | break; |
183 | case 3 : /* Aspect_TOL_DOTDASH */ |
184 | linetype = CALL_PHIGS_LINE_DASH_DOT; |
185 | break; |
186 | default : |
187 | break; |
188 | } |
189 | |
190 | linewidth =( Tfloat ) agroup->ContextFillArea.Width; |
191 | |
192 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
193 | polyOffsetMode = agroup->ContextFillArea.PolygonOffsetMode; |
194 | polyOffsetFactor = agroup->ContextFillArea.PolygonOffsetFactor; |
195 | polyOffsetUnits = agroup->ContextFillArea.PolygonOffsetUnits; |
196 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
197 | |
198 | switch( agroup->Struct->ContextFillArea.Style ) |
199 | { |
200 | case 0 : /* Aspect_IS_EMPTY */ |
201 | Intstyle = CALL_PHIGS_STYLE_EMPTY; |
202 | break; |
203 | case 1 : /* Aspect_IS_HOLLOW */ |
204 | Intstyle = CALL_PHIGS_STYLE_HOLLOW; |
205 | break; |
206 | case 2 : /* Aspect_IS_HATCH */ |
207 | Intstyle = CALL_PHIGS_STYLE_HATCH; |
208 | break; |
209 | case 3 : /* Aspect_IS_SOLID */ |
210 | Intstyle = CALL_PHIGS_STYLE_SOLID; |
211 | break; |
212 | case 4 : /* Aspect_IS_HIDDENLINE */ |
213 | intstyle = CALL_PHIGS_STYLE_HIDDENLINE; |
214 | break; |
215 | default : |
216 | break; |
217 | } |
218 | |
219 | switch( agroup->Struct->ContextFillArea.Hatch ) |
220 | { |
221 | case 0 : /* Aspect_HS_HORIZONTAL */ |
222 | Hatch = CALL_PHIGS_HATCH_HORIZ; |
223 | break; |
224 | case 1 : /* Aspect_HS_HORIZONTAL_WIDE */ |
225 | Hatch = CALL_PHIGS_HATCH_HORIZ_DBL; |
226 | break; |
227 | case 2 : /* Aspect_HS_VERTICAL */ |
228 | Hatch = CALL_PHIGS_HATCH_VERT; |
229 | break; |
230 | case 3 : /* Aspect_HS_VERTICAL_WIDE */ |
231 | Hatch = CALL_PHIGS_HATCH_VERT_DBL; |
232 | break; |
233 | case 4 : /* Aspect_HS_DIAGONAL_45 */ |
234 | Hatch = CALL_PHIGS_HATCH_DIAG_45; |
235 | break; |
236 | case 5 : /* Aspect_HS_DIAGONAL_45_WIDE */ |
237 | Hatch = CALL_PHIGS_HATCH_DIAG_45_DBL; |
238 | break; |
239 | case 6 : /* Aspect_HS_DIAGONAL_135 */ |
240 | Hatch = CALL_PHIGS_HATCH_DIAG_135; |
241 | break; |
242 | case 7 : /* Aspect_HS_DIAGONAL_135_WIDE */ |
243 | Hatch = CALL_PHIGS_HATCH_DIAG_135_DBL; |
244 | break; |
245 | case 8 : /* Aspect_HS_GRID */ |
246 | Hatch = CALL_PHIGS_HATCH_GRID_R; |
247 | break; |
248 | case 9 : /* Aspect_HS_GRID_WIDE */ |
249 | Hatch = CALL_PHIGS_HATCH_GRID_R_DBL; |
250 | break; |
251 | case 10 : /* Aspect_HS_GRID_DIAGONAL */ |
252 | Hatch = CALL_PHIGS_HATCH_GRID_D; |
253 | break; |
254 | case 11 : /* Aspect_HS_GRID_DIAGONAL_WIDE */ |
255 | Hatch = CALL_PHIGS_HATCH_GRID_D_DBL; |
256 | break; |
257 | default : |
258 | break; |
259 | } |
260 | |
261 | Fillr = agroup->Struct->ContextFillArea.IntColor.r; |
262 | Fillg = agroup->Struct->ContextFillArea.IntColor.g; |
263 | Fillb = agroup->Struct->ContextFillArea.IntColor.b; |
264 | |
265 | #ifdef OCC1174 |
266 | FillBackr = agroup->Struct->ContextFillArea.BackIntColor.r; |
267 | FillBackg = agroup->Struct->ContextFillArea.BackIntColor.g; |
268 | FillBackb = agroup->Struct->ContextFillArea.BackIntColor.b; |
269 | #endif |
270 | |
271 | Liner = agroup->Struct->ContextFillArea.EdgeColor.r; |
272 | Lineg = agroup->Struct->ContextFillArea.EdgeColor.g; |
273 | Lineb = agroup->Struct->ContextFillArea.EdgeColor.b; |
274 | |
275 | switch( agroup->Struct->ContextFillArea.LineType ) |
276 | { |
277 | case 0 : /* Aspect_TOL_SOLID */ |
278 | Linetype = CALL_PHIGS_LINE_SOLID; |
279 | break; |
280 | case 1 : /* Aspect_DASH */ |
281 | Linetype = CALL_PHIGS_LINE_DASH; |
282 | break; |
283 | case 2 : /* Aspect_TOL_DOT */ |
284 | Linetype = CALL_PHIGS_LINE_DOT; |
285 | break; |
286 | case 3 : /* Aspect_TOL_DOTDASH */ |
287 | Linetype = CALL_PHIGS_LINE_DASH_DOT; |
288 | break; |
289 | default : |
290 | break; |
291 | } |
292 | |
293 | Linewidth =( Tfloat ) agroup->Struct->ContextFillArea.Width; |
294 | |
295 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
296 | PolyOffsetMode = agroup->Struct->ContextFillArea.PolygonOffsetMode; |
297 | PolyOffsetFactor = agroup->Struct->ContextFillArea.PolygonOffsetFactor; |
298 | PolyOffsetUnits = agroup->Struct->ContextFillArea.PolygonOffsetUnits; |
299 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
300 | |
301 | if( noinsert == 1 ) |
302 | { |
303 | if( agroup->ContextFillArea.IsSet ) |
304 | call_func_set_edit_mode( CALL_PHIGS_EDIT_REPLACE ); |
305 | else |
306 | call_func_set_edit_mode( CALL_PHIGS_EDIT_INSERT ); |
307 | call_func_open_struct( agroup->Struct->Id ); |
308 | |
309 | call_func_set_elem_ptr( 0 ); |
310 | call_func_set_elem_ptr_label( agroup->LabelBegin ); |
311 | if( agroup->PickId.IsSet ) |
312 | call_func_offset_elem_ptr( 1 ); |
313 | if( agroup->ContextLine.IsSet ) |
314 | call_func_offset_elem_ptr( CALL_DEF_CONTEXTLINE_SIZE ); |
315 | /* interior */ |
316 | if( agroup->ContextFillArea.IsSet ) |
317 | call_func_offset_elem_ptr( 1 ); |
318 | call_func_set_int_style( intstyle ); |
319 | if( agroup->ContextFillArea.IsSet ) |
320 | call_func_offset_elem_ptr( 1 ); |
321 | call_subr_set_int_colr( fillr, fillg, fillb, ( float )1.0 ); |
322 | if( agroup->ContextFillArea.IsSet ) |
323 | call_func_offset_elem_ptr( 1 ); |
324 | #ifdef OCC1174 |
325 | call_subr_set_back_int_colr( fillBackr, fillBackg, fillBackb, ( float )1.0 ); |
326 | #else |
327 | call_subr_set_back_int_colr( fillr, fillg, fillb, ( float )1.0 ); |
328 | #endif |
329 | /* edge */ |
330 | if( agroup->ContextFillArea.IsSet ) |
331 | call_func_offset_elem_ptr( 1 ); |
332 | if( agroup->ContextFillArea.Edge ) |
333 | call_func_set_edge_flag( CALL_PHIGS_EDGE_ON ); |
334 | else |
335 | call_func_set_edge_flag( CALL_PHIGS_EDGE_OFF ); |
336 | if( agroup->ContextFillArea.IsSet ) |
337 | call_func_offset_elem_ptr( 1 ); |
338 | call_subr_set_edge_colr( liner, lineg, lineb ); |
339 | if( agroup->ContextFillArea.IsSet ) |
340 | call_func_offset_elem_ptr( 1 ); |
341 | call_func_set_edge_type( linetype ); |
342 | if( agroup->ContextFillArea.IsSet ) |
343 | call_func_offset_elem_ptr( 1 ); |
344 | call_func_set_edgewidth( linewidth ); |
345 | /* hatch */ |
346 | if( agroup->ContextFillArea.IsSet ) |
347 | call_func_offset_elem_ptr( 1 ); |
348 | if( intstyle == CALL_PHIGS_STYLE_HATCH ) |
349 | call_func_set_int_style_ind( hatch ); |
350 | else |
351 | call_func_appl_data( 0 ); |
352 | |
353 | /* front and back face */ |
354 | if( agroup->ContextFillArea.IsSet ) |
355 | call_func_offset_elem_ptr( 1 ); |
356 | if( agroup->ContextFillArea.Distinguish ) |
357 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_YES ); |
358 | else |
359 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_NO ); |
360 | if( agroup->ContextFillArea.IsSet ) |
361 | call_func_offset_elem_ptr( 1 ); |
362 | if( agroup->ContextFillArea.BackFace ) |
363 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_BACKFACE ); |
364 | else |
365 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_NONE ); |
366 | |
367 | /* front face */ |
368 | if( agroup->ContextFillArea.IsSet ) |
369 | call_func_offset_elem_ptr( 1 ); |
370 | |
371 | if( agroup->ContextFillArea.Front.IsAmbient ) |
372 | lightbool = lightbool | AMBIENT_MASK; |
373 | |
374 | if( agroup->ContextFillArea.Front.IsDiffuse ) |
375 | lightbool = lightbool | DIFFUSE_MASK; |
376 | |
377 | if( agroup->ContextFillArea.Front.IsSpecular ) |
378 | lightbool = lightbool | SPECULAR_MASK; |
379 | |
380 | if( agroup->ContextFillArea.Front.IsEmission ) |
381 | lightbool = lightbool | EMISSIVE_MASK; |
382 | |
383 | if( !lightbool ) |
384 | call_func_set_refl_eqn( CALL_PHIGS_REFL_NONE ); |
385 | else |
386 | call_func_set_refl_eqn( lightbool ); |
387 | |
388 | if( agroup->ContextFillArea.IsSet ) |
389 | call_func_offset_elem_ptr( 1 ); |
390 | |
391 | call_subr_set_refl_props( &agroup->ContextFillArea.Front, 0 ); |
392 | |
393 | /* back face */ |
394 | if( agroup->ContextFillArea.IsSet ) |
395 | call_func_offset_elem_ptr( 1 ); |
396 | |
397 | if( agroup->ContextFillArea.Back.IsAmbient ) |
398 | lightbool = lightbool | AMBIENT_MASK; |
399 | |
400 | if( agroup->ContextFillArea.Back.IsDiffuse ) |
401 | lightbool = lightbool | DIFFUSE_MASK; |
402 | |
403 | if( agroup->ContextFillArea.Back.IsSpecular ) |
404 | lightbool = lightbool | SPECULAR_MASK; |
405 | |
406 | if( agroup->ContextFillArea.Back.IsEmission ) |
407 | lightbool = lightbool | EMISSIVE_MASK; |
408 | |
409 | if( !lightbool ) |
410 | call_func_set_back_refl_eqn( CALL_PHIGS_REFL_NONE ); |
411 | else |
412 | call_func_set_back_refl_eqn( lightbool ); |
413 | |
414 | if( agroup->ContextFillArea.IsSet ) |
415 | call_func_offset_elem_ptr( 1 ); |
416 | call_subr_set_refl_props( &agroup->ContextFillArea.Back, 1 ); |
417 | |
418 | if( agroup->ContextFillArea.IsSet ) |
419 | call_func_offset_elem_ptr( 1 ); |
420 | call_func_set_do_texturemap(agroup->ContextFillArea.Texture.doTextureMap); |
421 | |
422 | if( agroup->ContextFillArea.IsSet ) |
423 | call_func_offset_elem_ptr( 1 ); |
424 | call_func_set_texture_id(agroup->ContextFillArea.Texture.TexId); |
425 | |
426 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
427 | if( agroup->ContextFillArea.IsSet ) |
428 | call_func_offset_elem_ptr( 1 ); |
429 | call_func_set_polygon_offset_params( polyOffsetMode, polyOffsetFactor, polyOffsetUnits ); |
430 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
431 | |
432 | call_func_set_elem_ptr_label( agroup->LabelEnd ); |
433 | call_func_offset_elem_ptr( -call_util_context_group_place( agroup ) |
434 | - 1 ); |
435 | /* interior */ |
436 | if( agroup->ContextLine.IsSet ) |
437 | call_func_offset_elem_ptr( CALL_DEF_CONTEXTLINE_SIZE ); |
438 | if( agroup->ContextFillArea.IsSet ) |
439 | call_func_offset_elem_ptr( 1 ); |
440 | call_func_set_int_style( Intstyle ); |
441 | if( agroup->ContextFillArea.IsSet ) |
442 | call_func_offset_elem_ptr( 1 ); |
443 | call_subr_set_int_colr( Fillr, Fillg, Fillb, ( float )1.0 ); |
444 | if( agroup->ContextFillArea.IsSet ) |
445 | call_func_offset_elem_ptr( 1 ); |
446 | #ifdef OCC1174 |
447 | call_subr_set_back_int_colr( FillBackr, FillBackg, FillBackb, ( float )1.0 ); |
448 | #else |
449 | call_subr_set_back_int_colr( Fillr, Fillg, Fillb, ( float )1.0 ); |
450 | #endif |
451 | /* edge */ |
452 | if( agroup->ContextFillArea.IsSet ) |
453 | call_func_offset_elem_ptr( 1 ); |
454 | if( agroup->ContextFillArea.Edge ) |
455 | call_func_set_edge_flag( CALL_PHIGS_EDGE_ON ); |
456 | else |
457 | call_func_set_edge_flag( CALL_PHIGS_EDGE_OFF ); |
458 | if( agroup->ContextFillArea.IsSet ) |
459 | call_func_offset_elem_ptr( 1 ); |
460 | call_subr_set_edge_colr( Liner, Lineg, Lineb ); |
461 | if( agroup->ContextFillArea.IsSet ) |
462 | call_func_offset_elem_ptr( 1 ); |
463 | call_func_set_edge_type( Linetype ); |
464 | if( agroup->ContextFillArea.IsSet ) |
465 | call_func_offset_elem_ptr( 1 ); |
466 | call_func_set_edgewidth( Linewidth ); |
467 | /* hatch */ |
468 | if( agroup->ContextFillArea.IsSet ) |
469 | call_func_offset_elem_ptr( 1 ); |
470 | if( Intstyle == CALL_PHIGS_STYLE_HATCH ) |
471 | call_func_set_int_style_ind( Hatch ); |
472 | else |
473 | call_func_appl_data( 0 ); |
474 | /* front and back face */ |
475 | if( agroup->ContextFillArea.IsSet ) |
476 | call_func_offset_elem_ptr( 1 ); |
477 | if( agroup->Struct->ContextFillArea.Distinguish ) |
478 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_YES ); |
479 | else |
480 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_NO ); |
481 | if( agroup->ContextFillArea.IsSet ) |
482 | call_func_offset_elem_ptr( 1 ); |
483 | if( agroup->Struct->ContextFillArea.BackFace ) |
484 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_BACKFACE ); |
485 | else |
486 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_NONE ); |
487 | |
488 | /* front face */ |
489 | if( agroup->ContextFillArea.IsSet ) |
490 | call_func_offset_elem_ptr( 1 ); |
491 | |
492 | if( agroup->Struct->ContextFillArea.Front.IsAmbient ) |
493 | lightbool = lightbool | AMBIENT_MASK; |
494 | |
495 | if( agroup->Struct->ContextFillArea.Front.IsDiffuse ) |
496 | lightbool = lightbool | DIFFUSE_MASK; |
497 | |
498 | if( agroup->Struct->ContextFillArea.Front.IsSpecular ) |
499 | lightbool = lightbool | SPECULAR_MASK; |
500 | |
501 | if( agroup->Struct->ContextFillArea.Front.IsEmission ) |
502 | lightbool = lightbool | EMISSIVE_MASK; |
503 | |
504 | if( !lightbool ) |
505 | call_func_set_refl_eqn( CALL_PHIGS_REFL_NONE ); |
506 | else |
507 | call_func_set_refl_eqn( lightbool ); |
508 | |
509 | if( agroup->ContextFillArea.IsSet ) |
510 | call_func_offset_elem_ptr( 1 ); |
511 | call_subr_set_refl_props( &agroup->Struct->ContextFillArea.Front, 0 ); |
512 | |
513 | /* back face */ |
514 | if( agroup->ContextFillArea.IsSet ) |
515 | call_func_offset_elem_ptr( 1 ); |
516 | |
517 | if( agroup->Struct->ContextFillArea.Back.IsAmbient ) |
518 | lightbool = lightbool | AMBIENT_MASK; |
519 | |
520 | if( agroup->Struct->ContextFillArea.Back.IsDiffuse ) |
521 | lightbool = lightbool | DIFFUSE_MASK; |
522 | |
523 | if( agroup->Struct->ContextFillArea.Back.IsSpecular ) |
524 | lightbool = lightbool | SPECULAR_MASK; |
525 | |
526 | if( agroup->Struct->ContextFillArea.Back.IsEmission ) |
527 | lightbool = lightbool | EMISSIVE_MASK; |
528 | |
529 | if( !lightbool ) |
530 | call_func_set_back_refl_eqn( CALL_PHIGS_REFL_NONE ); |
531 | else |
532 | call_func_set_back_refl_eqn( lightbool ); |
533 | |
534 | if( agroup->ContextFillArea.IsSet ) |
535 | call_func_offset_elem_ptr( 1 ); |
536 | call_subr_set_refl_props( &agroup->Struct->ContextFillArea.Back, 1 ); |
537 | |
538 | if( agroup->ContextFillArea.IsSet ) |
539 | call_func_offset_elem_ptr( 1 ); |
540 | call_func_set_do_texturemap(agroup->Struct->ContextFillArea.Texture.doTextureMap); |
541 | |
542 | if( agroup->ContextFillArea.IsSet ) |
543 | call_func_offset_elem_ptr( 1 ); |
544 | call_func_set_texture_id(agroup->Struct->ContextFillArea.Texture.TexId); |
545 | |
546 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
547 | if( agroup->ContextFillArea.IsSet ) |
548 | call_func_offset_elem_ptr( 1 ); |
549 | call_func_set_polygon_offset_params( PolyOffsetMode, PolyOffsetFactor, PolyOffsetUnits ); |
550 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
551 | |
552 | /* ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate ) */ |
553 | /*call_func_offset_elem_ptr( 1 );*/ |
554 | /*call_func_set_transform_persistence( TransPers );*/ |
555 | /* ABD 29/10/04 Transform Persistence of Presentation( pan, zoom, rotate ) */ |
556 | |
557 | call_func_close_struct(); |
558 | } /* no insert */ |
559 | |
560 | if( noinsert == 0 ) |
561 | { |
562 | call_func_set_edit_mode( CALL_PHIGS_EDIT_INSERT ); |
563 | call_func_open_struct( agroup->Struct->Id ); |
564 | |
565 | call_func_set_elem_ptr( 0 ); |
566 | call_func_set_elem_ptr_label( agroup->LabelEnd ); |
567 | call_func_offset_elem_ptr( -call_util_context_group_place( agroup ) |
568 | - 1 ); |
569 | call_func_set_int_style( intstyle ); |
570 | call_subr_set_int_colr( fillr, fillg, fillb, ( float )1.0 ); |
571 | #ifdef OCC1174 |
572 | call_subr_set_back_int_colr( fillBackr, fillBackg, fillBackb, ( float )1.0 ); |
573 | #else |
574 | call_subr_set_back_int_colr( fillr, fillg, fillb, ( float )1.0 ); |
575 | #endif |
576 | if( agroup->ContextFillArea.Edge ) |
577 | call_func_set_edge_flag( CALL_PHIGS_EDGE_ON ); |
578 | else |
579 | call_func_set_edge_flag( CALL_PHIGS_EDGE_OFF ); |
580 | call_subr_set_edge_colr( liner, lineg, lineb ); |
581 | call_func_set_edge_type( linetype ); |
582 | call_func_set_edgewidth( linewidth ); |
583 | if( intstyle == CALL_PHIGS_STYLE_HATCH ) |
584 | call_func_set_int_style_ind( hatch ); |
585 | else |
586 | call_func_appl_data( 0 ); |
587 | if( agroup->ContextFillArea.Distinguish ) |
588 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_YES ); |
589 | else |
590 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_NO ); |
591 | if( agroup->ContextFillArea.BackFace ) |
592 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_BACKFACE ); |
593 | else |
594 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_NONE ); |
595 | |
596 | /* front face */ |
597 | if( agroup->ContextFillArea.Front.IsAmbient ) |
598 | lightbool = lightbool | AMBIENT_MASK; |
599 | |
600 | if( agroup->ContextFillArea.Front.IsDiffuse ) |
601 | lightbool = lightbool | DIFFUSE_MASK; |
602 | |
603 | if( agroup->ContextFillArea.Front.IsSpecular ) |
604 | lightbool = lightbool | SPECULAR_MASK; |
605 | |
606 | if( agroup->ContextFillArea.Front.IsEmission ) |
607 | lightbool = lightbool | EMISSIVE_MASK; |
608 | |
609 | if( !lightbool ) |
610 | call_func_set_refl_eqn( CALL_PHIGS_REFL_NONE ); |
611 | else |
612 | call_func_set_refl_eqn( lightbool ); |
613 | |
614 | call_subr_set_refl_props( &agroup->ContextFillArea.Front, 0 ); |
615 | |
616 | /* back face */ |
617 | if( agroup->ContextFillArea.Back.IsAmbient ) |
618 | lightbool = lightbool | AMBIENT_MASK; |
619 | |
620 | if( agroup->ContextFillArea.Back.IsDiffuse ) |
621 | lightbool = lightbool | DIFFUSE_MASK; |
622 | |
623 | if( agroup->ContextFillArea.Back.IsSpecular ) |
624 | lightbool = lightbool | SPECULAR_MASK; |
625 | |
626 | if( agroup->ContextFillArea.Back.IsEmission ) |
627 | lightbool = lightbool | EMISSIVE_MASK; |
628 | |
629 | if( !lightbool ) |
630 | call_func_set_back_refl_eqn( CALL_PHIGS_REFL_NONE ); |
631 | else |
632 | call_func_set_back_refl_eqn( lightbool ); |
633 | |
634 | call_subr_set_refl_props( &agroup->ContextFillArea.Back, 1 ); |
635 | |
636 | call_func_set_do_texturemap(agroup->ContextFillArea.Texture.doTextureMap); |
637 | |
638 | call_func_set_texture_id(agroup->ContextFillArea.Texture.TexId); |
639 | |
640 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
641 | call_func_set_polygon_offset_params( polyOffsetMode, polyOffsetFactor, polyOffsetUnits ); |
642 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
643 | |
644 | |
645 | if( agroup->ContextLine.IsSet ) |
646 | call_func_offset_elem_ptr( CALL_DEF_CONTEXTLINE_SIZE ); |
647 | if( !agroup->ContextFillArea.IsSet ) |
648 | { |
649 | call_func_set_int_style( Intstyle ); |
650 | call_subr_set_int_colr( Fillr, Fillg, Fillb, ( float )1.0 ); |
651 | #ifdef OCC1174 |
652 | call_subr_set_back_int_colr( FillBackr, FillBackg, FillBackb, ( float )1.0 ); |
653 | #else |
654 | call_subr_set_back_int_colr( Fillr, Fillg, Fillb, ( float )1.0 ); |
655 | #endif |
656 | if( agroup->Struct->ContextFillArea.Edge ) |
657 | call_func_set_edge_flag( CALL_PHIGS_EDGE_ON ); |
658 | else |
659 | call_func_set_edge_flag( CALL_PHIGS_EDGE_OFF ); |
660 | call_subr_set_edge_colr( Liner, Lineg, Lineb ); |
661 | call_func_set_edge_type( Linetype ); |
662 | call_func_set_edgewidth( Linewidth ); |
663 | if( Intstyle == CALL_PHIGS_STYLE_HATCH ) |
664 | call_func_set_int_style_ind( Hatch ); |
665 | else |
666 | call_func_appl_data( 0 ); |
667 | if( agroup->Struct->ContextFillArea.Distinguish ) |
668 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_YES ); |
669 | else |
670 | call_func_set_face_disting_mode( CALL_PHIGS_DISTING_NO ); |
671 | if( agroup->Struct->ContextFillArea.BackFace ) |
672 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_BACKFACE ); |
673 | else |
674 | call_func_set_face_cull_mode( CALL_PHIGS_CULL_NONE ); |
675 | |
676 | /* front face */ |
677 | if( agroup->Struct->ContextFillArea.Front.IsAmbient ) |
678 | lightbool = lightbool | AMBIENT_MASK; |
679 | |
680 | if( agroup->Struct->ContextFillArea.Front.IsDiffuse ) |
681 | lightbool = lightbool | DIFFUSE_MASK; |
682 | |
683 | if( agroup->Struct->ContextFillArea.Front.IsSpecular ) |
684 | lightbool = lightbool | SPECULAR_MASK; |
685 | |
686 | if( agroup->Struct->ContextFillArea.Front.IsEmission ) |
687 | lightbool = lightbool | EMISSIVE_MASK; |
688 | |
689 | if( !lightbool ) |
690 | call_func_set_refl_eqn( CALL_PHIGS_REFL_NONE ); |
691 | else |
692 | call_func_set_refl_eqn( lightbool ); |
693 | |
694 | call_subr_set_refl_props( &agroup->Struct->ContextFillArea.Front, 0 ); |
695 | |
696 | /* back face */ |
697 | if( agroup->Struct->ContextFillArea.Back.IsAmbient ) |
698 | lightbool = lightbool | AMBIENT_MASK; |
699 | |
700 | if( agroup->Struct->ContextFillArea.Back.IsDiffuse ) |
701 | lightbool = lightbool | DIFFUSE_MASK; |
702 | |
703 | if( agroup->Struct->ContextFillArea.Back.IsSpecular ) |
704 | lightbool = lightbool | SPECULAR_MASK; |
705 | |
706 | if( agroup->Struct->ContextFillArea.Back.IsEmission ) |
707 | lightbool = lightbool | EMISSIVE_MASK; |
708 | |
709 | if( !lightbool ) |
710 | call_func_set_back_refl_eqn( CALL_PHIGS_REFL_NONE ); |
711 | else |
712 | call_func_set_back_refl_eqn( lightbool ); |
713 | |
714 | call_subr_set_refl_props(&agroup->Struct->ContextFillArea.Back, 1); |
715 | |
716 | call_func_set_do_texturemap(agroup->Struct->ContextFillArea.Texture.doTextureMap); |
717 | |
718 | call_func_set_texture_id(agroup->Struct->ContextFillArea.Texture.TexId); |
719 | |
720 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
721 | call_func_set_polygon_offset_params( PolyOffsetMode, PolyOffsetFactor, PolyOffsetUnits ); |
722 | /* OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets */ |
723 | } |
724 | |
725 | call_func_close_struct(); |
726 | } /* insert */ |
727 | |
728 | } |
729 | /* Voir commentaire en debut de fonction */ |
730 | if (agroup->IsOpen) call_togl_opengroup (agroup); |
731 | return; |
732 | } |