1 /***********************************************************************
5 File OpenGl_linecontextgroup :
11 HISTORIQUE DES MODIFICATIONS :
12 --------------------------------
13 xx-xx-xx : xxx ; Creation.
14 03-09-97 : FMN ; Ajout traitement Begin/EndPrimitives()
15 03-03-98 : CAL ; Modification des structures CALL_DEF_GROUP et STRUCTURE
17 ************************************************************************/
19 /*----------------------------------------------------------------------*/
24 #include <OpenGl_tgl_all.hxx>
25 #include <InterfaceGraphic_Graphic3d.hxx>
26 #include <OpenGl_tgl.hxx>
27 #include <OpenGl_tgl_funcs.hxx>
28 #include <OpenGl_tgl_subrs.hxx>
29 #include <OpenGl_tgl_utilgr.hxx>
31 /*----------------------------------------------------------------------*/
34 call_togl_linecontextgroup
36 CALL_DEF_GROUP * agroup,
41 Tfloat liner, lineg, lineb;
45 /* for the structure */
46 Tfloat Liner, Lineg, Lineb;
51 * Si le groupe est ouvert cela signifie que BeginPrimitives
53 * Dans le cas des markers composes, il faut refermer temporairement
54 * le groupe pour eviter des insertions d'attributs aleatoires.
56 if (agroup->IsOpen) call_togl_closegroup (agroup);
58 if( agroup->ContextLine.IsDef )
60 liner = agroup->ContextLine.Color.r;
61 lineg = agroup->ContextLine.Color.g;
62 lineb = agroup->ContextLine.Color.b;
64 switch( agroup->ContextLine.LineType )
66 case 0 : /* Aspect_TOL_SOLID */
67 linetype = CALL_PHIGS_LINE_SOLID;
69 case 1 : /* Aspect_DASH */
70 linetype = CALL_PHIGS_LINE_DASH;
72 case 2 : /* Aspect_TOL_DOT */
73 linetype = CALL_PHIGS_LINE_DOT;
75 case 3 : /* Aspect_TOL_DOTDASH */
76 linetype = CALL_PHIGS_LINE_DASH_DOT;
81 linewidth = (Tfloat)agroup->ContextLine.Width;
83 Liner = agroup->Struct->ContextLine.Color.r;
84 Lineg = agroup->Struct->ContextLine.Color.g;
85 Lineb = agroup->Struct->ContextLine.Color.b;
87 switch( agroup->Struct->ContextLine.LineType )
89 case 0 : /* Aspect_TOL_SOLID */
90 Linetype = CALL_PHIGS_LINE_SOLID;
92 case 1 : /* Aspect_DASH */
93 Linetype = CALL_PHIGS_LINE_DASH;
95 case 2 : /* Aspect_TOL_DOT */
96 Linetype = CALL_PHIGS_LINE_DOT;
98 case 3 : /* Aspect_TOL_DOTDASH */
99 Linetype = CALL_PHIGS_LINE_DASH_DOT;
104 Linewidth = (Tfloat)agroup->Struct->ContextLine.Width;
106 /*TransPers = agroup->TransformPersistenceFlag;*/
110 if( agroup->ContextLine.IsSet )
111 call_func_set_edit_mode( CALL_PHIGS_EDIT_REPLACE );
113 call_func_set_edit_mode( CALL_PHIGS_EDIT_INSERT );
114 call_func_open_struct( agroup->Struct->Id );
116 call_func_set_elem_ptr( 0 );
117 call_func_set_elem_ptr_label( agroup->LabelBegin );
118 if( agroup->PickId.IsSet )
119 call_func_offset_elem_ptr( 1 );
120 if( agroup->ContextLine.IsSet )
121 call_func_offset_elem_ptr( 1 );
122 call_subr_set_line_colr( liner, lineg, lineb );
123 if( agroup->ContextLine.IsSet )
124 call_func_offset_elem_ptr( 1 );
125 call_func_set_linetype( linetype );
126 if( agroup->ContextLine.IsSet )
127 call_func_offset_elem_ptr( 1 );
128 call_func_set_linewidth( linewidth );
130 call_func_set_elem_ptr_label( agroup->LabelEnd );
131 call_func_offset_elem_ptr( -call_util_context_group_place( agroup )
133 if( agroup->ContextLine.IsSet )
134 call_func_offset_elem_ptr( 1 );
135 call_subr_set_line_colr( Liner, Lineg, Lineb );
136 if( agroup->ContextLine.IsSet )
137 call_func_offset_elem_ptr( 1 );
138 call_func_set_linetype( Linetype );
139 if( agroup->ContextLine.IsSet )
140 call_func_offset_elem_ptr( 1 );
141 call_func_set_linewidth( Linewidth );
142 call_func_close_struct( );
147 call_func_set_edit_mode( CALL_PHIGS_EDIT_INSERT );
148 call_func_open_struct( agroup->Struct->Id );
150 call_func_set_elem_ptr( 0 );
151 call_func_set_elem_ptr_label( agroup->LabelEnd );
152 call_func_offset_elem_ptr( -call_util_context_group_place( agroup )
154 call_subr_set_line_colr( liner, lineg, lineb );
155 call_func_set_linetype( linetype );
156 call_func_set_linewidth( linewidth );
158 if( !agroup->ContextLine.IsSet )
160 call_subr_set_line_colr( Liner, Lineg, Lineb );
161 call_func_set_linetype( Linetype );
162 call_func_set_linewidth( Linewidth );
164 call_func_close_struct();
167 /* Voir commentaire en debut de fonction */
168 if (agroup->IsOpen) call_togl_opengroup (agroup);