2 #include <OpenGl_tgl_all.hxx>
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_Memory.hxx>
16 static TStatus SurfaceAreaPropertiesDisplay( TSM_ELEM_DATA, Tint, cmn_key* );
17 static TStatus SurfaceAreaPropertiesAdd( TSM_ELEM_DATA, Tint, cmn_key* );
18 static TStatus SurfaceAreaPropertiesDelete( TSM_ELEM_DATA, Tint, cmn_key* );
19 static TStatus SurfaceAreaPropertiesPrint( TSM_ELEM_DATA, Tint, cmn_key* );
20 static TStatus SurfaceAreaPropertiesInquire( TSM_ELEM_DATA, Tint, cmn_key* );
22 static TStatus (*MtdTbl[])( TSM_ELEM_DATA, Tint, cmn_key* ) =
25 SurfaceAreaPropertiesDisplay,
26 SurfaceAreaPropertiesAdd,
27 SurfaceAreaPropertiesDelete,
28 SurfaceAreaPropertiesPrint,
29 SurfaceAreaPropertiesInquire
34 TelSurfaceAreaPropertiesInitClass( TelType *el )
36 *el = TelSurfaceAreaProperties;
41 SurfaceAreaPropertiesAdd( TSM_ELEM_DATA d, Tint n, cmn_key *k )
43 tel_surf_prop data = new TEL_SURF_PROP();;
45 //cmn_memreserve( data, 1, 0 );
49 *data = *(tel_surf_prop)(k[0]->data.pdata);
51 ((tsm_elem_data)(d.pdata))->pdata = data;
58 SurfaceAreaPropertiesDisplay( TSM_ELEM_DATA data, Tint n, cmn_key *k )
62 key.id = TelSurfaceAreaProperties;
63 key.data.pdata = data.pdata;
64 TsmSetAttri( 1, &key );
71 SurfaceAreaPropertiesDelete( TSM_ELEM_DATA data, Tint n, cmn_key *k )
73 //cmn_freemem( data.pdata );
83 SurfaceAreaPropertiesPrint( TSM_ELEM_DATA data, Tint n, cmn_key *k )
87 p = (tel_surf_prop)data.pdata;
89 fprintf( stdout, "TelSurfaceAreaProperties\n" );
90 fprintf( stdout, "\tAmbient Coeff: %f\n", p->amb );
91 fprintf( stdout, "\tDiffuse Coeff: %f\n", p->diff );
92 fprintf( stdout, "\tSpecular Coeff: %f\n", p->spec );
93 fprintf( stdout, "\tTransparency Coeff: %f\n", p->trans );
94 fprintf( stdout, "\tShininess: %f\n", p->shine );
95 fprintf( stdout, "\tSpecular colour: R = %f, G = %f, B = %f\n",
96 p->speccol.rgb[0], p->speccol.rgb[1], p->speccol.rgb[2] );
97 fprintf( stdout, "\n" );
104 SurfaceAreaPropertiesInquire( TSM_ELEM_DATA data, Tint n, cmn_key *k )
109 p = (tel_surf_prop)data.pdata;
111 for( i = 0; i < n; i++ )
115 case INQ_GET_SIZE_ID:
117 k[i]->data.ldata = sizeof( Tint );
120 case INQ_GET_CONTENT_ID:
125 c = (tel_inq_content)k[i]->data.pdata;