0022792: Globally defined symbol PI conflicts with VTK definition (Intel compiler)
[occt.git] / src / OpenGl / OpenGl_bintcol.cxx
CommitLineData
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
13static TStatus BackInteriorColourDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
14static TStatus BackInteriorColourAdd( TSM_ELEM_DATA, Tint, cmn_key* );
15static TStatus BackInteriorColourDelete( TSM_ELEM_DATA, Tint, cmn_key* );
16static TStatus BackInteriorColourPrint( TSM_ELEM_DATA, Tint, cmn_key* );
17static TStatus BackInteriorColourInquire( TSM_ELEM_DATA, Tint, cmn_key* );
18
19static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) =
20{
21 0, /* PickTraverse */
22 BackInteriorColourDisplay,
23 BackInteriorColourAdd,
24 BackInteriorColourDelete,
25 BackInteriorColourPrint,
26 BackInteriorColourInquire
27};
28
29
30MtblPtr
31TelBackInteriorColourInitClass( TelType *el )
32{
33 *el = TelBackInteriorColour;
34 return MtdTbl;
35}
36
37static TStatus
38BackInteriorColourAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k )
39{
40 tel_colour data = new TEL_COLOUR();
41
42 if( !data )
43 return TFailure;
44
45 *data = *(tel_colour)(k[0]->data.pdata);
46
47 ((tsm_elem_data)(d.pdata))->pdata = data;
48
49 return TSuccess;
50}
51
52
53static TStatus
54BackInteriorColourDisplay( TSM_ELEM_DATA data, Tint n, cmn_key *k )
55{
56 tel_colour d;
57 CMN_KEY key;
58
59 d = (tel_colour)data.pdata;
60
61 key.id = TelBackInteriorColour;
62 key.data.pdata = d;
63 TsmSetAttri( 1, &key );
64
65 return TSuccess;
66}
67
68
69static TStatus
70BackInteriorColourDelete( TSM_ELEM_DATA data, Tint n, cmn_key *k )
71{
72 if (data.pdata)
73 delete data.pdata;
74 return TSuccess;
75}
76
77
78
79
80static TStatus
81BackInteriorColourPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
82{
83 tel_colour p;
84
85 p = (tel_colour)data.pdata;
86
87 fprintf( stdout, "TelBackInteriorColour. R = %g, G = %g, B = %g\n",
88 p->rgb[0], p->rgb[1], p->rgb[2] );
89 fprintf( stdout, "\n" );
90
91 return TSuccess;
92}
93
94
95static TStatus
96BackInteriorColourInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
97{
98 Tint i;
99 tel_colour col = (tel_colour)data.pdata;
100
101 for( i = 0; i < n; i++ )
102 {
103 switch( k[i]->id )
104 {
105 case INQ_GET_SIZE_ID:
106 {
107 k[i]->data.ldata = sizeof( Tint );
108 break;
109 }
110 case INQ_GET_CONTENT_ID:
111 {
112 TEL_INQ_CONTENT *c;
113 Teldata *w;
114
115 c = (tel_inq_content)k[i]->data.pdata;
116 w = c->data;
117 c->act_size = 0;
118
119 w->gnl_colour.rgb[0] = col->rgb[0];
120 w->gnl_colour.rgb[1] = col->rgb[1];
121 w->gnl_colour.rgb[2] = col->rgb[2];
122 break;
123 }
124 }
125 }
126
127 return TSuccess;
128}