7fd59977 |
1 | |
2 | #include <OpenGl_tgl_all.hxx> |
3 | |
4 | #include <stddef.h> |
5 | #include <stdio.h> |
6 | |
7 | #include <OpenGl_cmn_varargs.hxx> |
8 | #include <OpenGl_telem_attri.hxx> |
9 | #include <OpenGl_tsm.hxx> |
10 | #include <OpenGl_telem.hxx> |
11 | #include <OpenGl_telem_inquire.hxx> |
12 | |
13 | static TStatus FaceDistinguishingModeAdd( TSM_ELEM_DATA, Tint, cmn_key* ); |
14 | static TStatus FaceDistinguishingModeDisplay( TSM_ELEM_DATA, Tint, cmn_key* ); |
15 | static TStatus FaceDistinguishingModePrint( TSM_ELEM_DATA, Tint, cmn_key* ); |
16 | static TStatus FaceDistinguishingModeInquire( TSM_ELEM_DATA, Tint, cmn_key* ); |
17 | |
18 | static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) = |
19 | { |
20 | 0, /* PickTraverse */ |
21 | FaceDistinguishingModeDisplay, |
22 | FaceDistinguishingModeAdd, |
23 | 0, /* Delete */ |
24 | FaceDistinguishingModePrint, |
25 | FaceDistinguishingModeInquire, |
26 | }; |
27 | |
28 | |
29 | MtblPtr |
30 | TelFaceDistinguishingModeInitClass( TelType *el ) |
31 | { |
32 | *el = TelFaceDistinguishingMode; |
33 | return MtdTbl; |
34 | } |
35 | |
36 | static TStatus |
37 | FaceDistinguishingModeAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k ) |
38 | { |
39 | ((tsm_elem_data)(d.pdata))->ldata = k[0]->data.ldata; |
40 | |
41 | return TSuccess; |
42 | } |
43 | |
44 | |
45 | static TStatus |
46 | FaceDistinguishingModeDisplay( TSM_ELEM_DATA d, Tint n, cmn_key *k ) |
47 | { |
48 | CMN_KEY key; |
49 | |
50 | key.id = TelFaceDistinguishingMode; |
51 | key.data.ldata = d.ldata; |
52 | TsmSetAttri( 1, &key ); |
53 | return TSuccess; |
54 | } |
55 | |
56 | |
57 | static TStatus |
58 | FaceDistinguishingModePrint( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
59 | { |
60 | data.ldata == TOn ? |
61 | fprintf( stdout, "TelFaceDistinguishingMode. Value = ON\n" ) : |
62 | fprintf( stdout, "TelFaceDistinguishingMode. Value = OFF\n" ); |
63 | fprintf( stdout, "\n" ); |
64 | |
65 | return TSuccess; |
66 | } |
67 | |
68 | |
69 | static TStatus |
70 | FaceDistinguishingModeInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k ) |
71 | { |
72 | Tint i; |
73 | |
74 | for( i = 0; i < n; i++ ) |
75 | { |
76 | switch( k[i]->id ) |
77 | { |
78 | case INQ_GET_SIZE_ID: |
79 | { |
80 | k[i]->data.ldata = sizeof( Tint ); |
81 | break; |
82 | } |
83 | case INQ_GET_CONTENT_ID: |
84 | { |
85 | TEL_INQ_CONTENT *c; |
86 | Teldata *w; |
87 | |
88 | c = (tel_inq_content)k[i]->data.pdata; |
89 | w = c->data; |
90 | c->act_size = 0; |
91 | /* w->face_processing_mode.distinguish = data.ldata; */ |
92 | w->idata = data.ldata; |
93 | break; |
94 | } |
95 | } |
96 | } |
97 | |
98 | return TSuccess; |
99 | } |