7fd59977 |
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 <GL/gl.h> |
6 | |
7 | void EXPORT |
8 | /* unimplemented */ |
9 | call_togl_setplane |
10 | ( |
11 | CALL_DEF_VIEW * aview |
12 | ) |
13 | { |
14 | #ifdef GER61454 |
15 | CALL_DEF_PLANE *plane; |
16 | int j,planeid ; |
17 | |
18 | if( aview->Context.NbActivePlane > 0 ) { |
19 | for( j=0 ; j<aview->Context.NbActivePlane ; j++ ) { |
20 | plane = &aview->Context.ActivePlane[j]; |
21 | if( plane->PlaneId > 0 ) { |
22 | planeid = GL_CLIP_PLANE2 + j; |
23 | if( plane->Active ) { |
24 | GLdouble equation[4]; |
25 | equation[0] = plane->CoefA; |
26 | equation[1] = plane->CoefB; |
27 | equation[2] = plane->CoefC; |
28 | equation[3] = plane->CoefD; |
29 | /* |
30 | Activates new clip planes |
31 | */ |
32 | glClipPlane( planeid , equation ); |
33 | if( !glIsEnabled( planeid ) ) glEnable( planeid ); |
34 | } else { |
35 | if( glIsEnabled( planeid ) ) glDisable( planeid ); |
36 | } |
37 | } |
38 | } |
39 | } |
40 | /* |
41 | Disable the remainder Clip planes |
42 | */ |
43 | for( j=aview->Context.NbActivePlane ; j<call_facilities_list.MaxPlanes ; j++ ) { |
44 | planeid = GL_CLIP_PLANE2 + j; |
45 | if( glIsEnabled( planeid ) ) glDisable( planeid ); |
46 | } |
47 | #endif |
48 | return; |
49 | } |