Integration of OCCT 6.5.0 from SVN
[occt.git] / src / OpenGl / OpenGl_vind.cxx
1 /***********************************************************************
2
3 FONCTION :
4 ----------
5 File OpenGl_vind :
6
7
8 REMARQUES:
9 ---------- 
10
11
12 HISTORIQUE DES MODIFICATIONS   :
13 --------------------------------
14 xx-xx-xx : xxx ; Creation.
15 20-02-96 : FMN ; Suppression code inutile:
16 01-04-96 : CAL ; Integration MINSK portage WNT
17 05-01-98 : FMN ; Suppression WNT inutile
18
19 ************************************************************************/
20
21 /*----------------------------------------------------------------------*/
22 /*
23 * Includes
24 */
25
26 #include <OpenGl_tgl_all.hxx>
27
28 #include <stddef.h>
29 #include <stdio.h>
30
31 #include <OpenGl_cmn_varargs.hxx>
32 #include <OpenGl_tsm.hxx>
33 #include <OpenGl_telem.hxx>
34 #include <OpenGl_telem_view.hxx>
35 #include <OpenGl_telem_inquire.hxx>
36 #include <OpenGl_telem_attri.hxx>
37
38 /*----------------------------------------------------------------------*/
39 /*
40 * Fonctions statiques
41 */
42
43 static  TStatus  ViewIndexDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
44 static  TStatus  ViewIndexAdd( TSM_ELEM_DATA, Tint, cmn_key* );
45 static  TStatus  ViewIndexPrint( TSM_ELEM_DATA, Tint, cmn_key* );
46 static  TStatus  ViewIndexInquire( TSM_ELEM_DATA, Tint, cmn_key* );
47
48 static  TStatus  (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) =
49 {
50   ViewIndexDisplay,             /* PickTraverse */
51     ViewIndexDisplay,
52     ViewIndexAdd,
53     0,             /* Delete */
54     ViewIndexPrint,
55     ViewIndexInquire
56 };
57
58 /*----------------------------------------------------------------------*/
59
60 MtblPtr
61 TelViewIndexInitClass( TelType *el )
62 {
63   *el = TelViewIndex;
64   return MtdTbl;
65 }
66
67 /*----------------------------------------------------------------------*/
68
69 static  TStatus
70 ViewIndexAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k )
71 {
72   ((tsm_elem_data)(d.pdata))->ldata = k[0]->data.ldata;
73
74   return TSuccess;
75 }
76
77 /*----------------------------------------------------------------------*/
78
79 static  TStatus
80 ViewIndexDisplay( TSM_ELEM_DATA data, Tint n, cmn_key *k )
81 {
82   CMN_KEY   kk;
83
84   kk.id = TelViewIndex;
85   kk.data.ldata = data.ldata;
86   TsmSetAttri( 1, &kk );
87   if( k[0]->id == TOn )
88     TelSetViewIndex( TglActiveWs, data.ldata );
89   return  TSuccess;
90 }
91
92 /*----------------------------------------------------------------------*/
93
94 static  TStatus
95 ViewIndexPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
96 {
97   fprintf( stdout, "TelViewIndex. Value = %d\n", data.ldata);
98   fprintf( stdout, "\n" );
99
100   return TSuccess;
101 }
102
103 /*----------------------------------------------------------------------*/
104
105 static TStatus
106 ViewIndexInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
107 {
108   Tint i;
109
110   for( i = 0; i < n; i++ )
111   {
112     switch( k[i]->id )
113     {
114     case INQ_GET_SIZE_ID:
115       {
116         k[i]->data.ldata = sizeof( Tint );
117         break;
118       }
119     case INQ_GET_CONTENT_ID:
120       {
121         TEL_INQ_CONTENT *c;
122         Teldata         *w;
123
124         c = (TEL_INQ_CONTENT*)(k[i]->data.pdata);
125         w = c->data;
126         c->act_size = 0;
127         w->idata = data.ldata;
128         break;
129       }
130     }
131   }
132
133   return TSuccess;
134 }
135 /*----------------------------------------------------------------------*/