0022819: Redesign of OpenGl driver
[occt.git] / src / OpenGl / OpenGl_togl_setplane.cxx
1 #define GER61454        //GG 14-09-99 Activates the model clipping planes
2
3 #include <OpenGl_tgl_all.hxx>
4 #include <OpenGl_tgl.hxx>
5 #include <OpenGl_tgl_funcs.hxx>
6 #include <OpenGl_telem_view.hxx>
7 #include <OpenGl_tsm_ws.hxx>
8 #include <GL/gl.h>
9
10
11 struct TEL_VIEW_DATA
12 {
13   TEL_VIEW_REP    vrep;
14 #ifdef CAL_100498
15   Tmatrix3        inverse_matrix;/* accelerates UVN2XYZ conversion */
16 #endif
17   IMPLEMENT_MEMORY_OPERATORS
18 };
19 typedef TEL_VIEW_DATA *tel_view_data;   /* Internal data stored for every view rep */
20
21
22 void EXPORT
23 /* unimplemented */
24 call_togl_setplane
25 (
26  CALL_DEF_VIEW * aview
27  )
28 {
29 #ifdef GER61454
30
31   CMN_KEY_DATA    key;
32   tel_view_data   vptr;
33   TEL_VIEW_REP   *call_viewrep;
34   CALL_DEF_PLANE *plane;
35   int j;
36   
37   // return view representation 
38   
39   if( aview->ViewId == 0 )
40     return;                 // no modifications on default view
41
42   if( TsmGetWSAttri( aview->WsId, WSViews, &key ) != TSuccess )
43     return;
44
45   vptr = (tel_view_data)key.pdata;
46   if( !vptr )
47     return;
48
49   call_viewrep = &vptr->vrep;
50   
51   // clear clipping planes information
52   call_viewrep->clipping_planes.Clear();
53   // update information 
54   if( aview->Context.NbActivePlane > 0 )
55     for( j=0 ; j<aview->Context.NbActivePlane ; j++ )
56       call_viewrep->clipping_planes.Append( aview->Context.ActivePlane[j] );
57  
58 #endif
59 return;
60 }