6e5af2be0a8f2ba31ae32254e76fbe239cf68ec2
[occt.git] / src / OpenGl / OpenGl_bintrefl.cxx
1 /*      08-04-98 : FGU ; Ajout emission  */
2 /*      05-01-99 : CAL ; Warning WNT     */
3
4 #include <OpenGl_tgl_all.hxx>
5
6 #include <stddef.h>
7 #include <stdio.h>
8
9 #include <OpenGl_cmn_varargs.hxx>
10 #include <OpenGl_telem_attri.hxx>
11 #include <OpenGl_tsm.hxx>
12 #include <OpenGl_telem.hxx>
13 #include <OpenGl_telem_inquire.hxx>
14 #include <OpenGl_tgl_funcs.hxx>
15
16 static  TStatus  BackInteriorReflectanceEquationAdd( TSM_ELEM_DATA, Tint, cmn_key* );
17 static  TStatus  BackInteriorReflectanceEquationDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
18 static  TStatus  BackInteriorReflectanceEquationPrint( TSM_ELEM_DATA, Tint, cmn_key* );
19 static  TStatus  BackInteriorReflectanceEquationInquire( TSM_ELEM_DATA, Tint, cmn_key* );
20
21 static  TStatus  (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) =
22 {
23   0,             /* PickTraverse */
24   BackInteriorReflectanceEquationDisplay,
25   BackInteriorReflectanceEquationAdd,
26   0,             /* Delete */
27   BackInteriorReflectanceEquationPrint,
28   BackInteriorReflectanceEquationInquire
29 };
30
31
32 MtblPtr
33 TelBackInteriorReflectanceEquationInitClass( TelType *el )
34 {
35   *el = TelBackInteriorReflectanceEquation;
36   return MtdTbl;
37 }
38
39 static  TStatus
40 BackInteriorReflectanceEquationAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k )
41 {
42   ((tsm_elem_data)(d.pdata))->ldata = k[0]->data.ldata;
43
44   return TSuccess;
45 }
46
47
48 static  TStatus
49 BackInteriorReflectanceEquationDisplay( TSM_ELEM_DATA d, Tint n, cmn_key *k )
50 {
51   CMN_KEY  key;
52
53   key.id = TelBackInteriorReflectanceEquation;
54   key.data.ldata = d.ldata;
55   TsmSetAttri( 1, &key );
56   return TSuccess;
57 }
58
59
60 static  TStatus
61 BackInteriorReflectanceEquationPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
62 {
63   switch( data.ldata )
64   {
65   case CALL_PHIGS_REFL_NONE:
66     fprintf( stdout, "TelBackInteriorReflectanceEquation. Value = \
67                      NONE\n" );
68     break;
69
70   default :
71     /* affichage du flag d etat des composants lumineux du materiel */
72     fprintf( stdout, "TelBackInteriorReflectanceEquation. Value = %d\n", data.ldata  );
73     break;
74
75     /*case TelLModelAmbient:
76     fprintf( stdout, "TelBackInteriorReflectanceEquation. Value = \
77     GL_AMBIENT\n" );
78     break;
79
80     case TelLModelDiffuse:
81     fprintf( stdout, "TelBackInteriorReflectanceEquation. Value = \
82     GL_AMBIENT_AND_DIFFUSE\n" );
83     break;*/
84
85     /* FSXXX */
86     /*case TelLModelSpecular:
87     fprintf( stdout, "TelBackInteriorReflectanceEquation. Value = \
88     GL_SPECULAR\n" );
89     break;*/
90   }
91   fprintf( stdout, "\n" );
92
93   return TSuccess;
94 }
95
96
97 static TStatus
98 BackInteriorReflectanceEquationInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
99 {
100   Tint i;
101
102   for( i = 0; i < n; i++ )
103   {
104     switch( k[i]->id )
105     {
106     case INQ_GET_SIZE_ID:
107       {
108         k[i]->data.ldata = sizeof( Tint );
109         break;
110       }
111     case INQ_GET_CONTENT_ID:
112       {
113         TEL_INQ_CONTENT *c;
114         Teldata         *w;
115
116         c = (tel_inq_content)k[i]->data.pdata;
117         w = c->data;
118         c->act_size = 0;
119         w->idata = data.ldata;
120         break;
121       }
122     }
123   }
124
125   return TSuccess;
126 }