1 /***********************************************************************
5 file OpenGl_togl_cliplimit.c :
12 HISTORIQUE DES MODIFICATIONS :
13 --------------------------------
14 xx-xx-xx : CAL ; Creation.
15 05-02-97 : FMN ; Suppression de OpenGl_tgl_vis.h
16 10-07-96 : FMN ; Suppression #define sur calcul matrice
18 ************************************************************************/
20 /*----------------------------------------------------------------------*/
25 #include <OpenGl_tgl_all.hxx>
26 #include <InterfaceGraphic_Graphic3d.hxx>
27 #include <InterfaceGraphic_Visual3d.hxx>
28 #include <OpenGl_tgl_funcs.hxx>
29 #include <OpenGl_telem_view.hxx>
31 /*----------------------------------------------------------------------*/
36 TEL_VIEW_REP call_viewrep;
38 /*----------------------------------------------------------------------*/
43 CALL_DEF_VIEW * aview,
49 call_viewrep.clip_limit.xmin = ( float )0.0;
50 call_viewrep.clip_limit.xmax = ( float )1.0;
51 call_viewrep.clip_limit.ymin = ( float )0.0;
52 call_viewrep.clip_limit.ymax = ( float )1.0;
54 call_viewrep.clip_limit.zmax =
55 ( aview->Context.ZClipFrontPlane - aview->Mapping.BackPlaneDistance ) /
56 ( aview->Mapping.FrontPlaneDistance - aview->Mapping.BackPlaneDistance );
57 call_viewrep.clip_limit.zmin =
58 ( aview->Context.ZClipBackPlane - aview->Mapping.BackPlaneDistance ) /
59 ( aview->Mapping.FrontPlaneDistance - aview->Mapping.BackPlaneDistance );
60 if( call_viewrep.clip_limit.zmin < 0.0 )
61 call_viewrep.clip_limit.zmin = ( float )0.0;
62 if( call_viewrep.clip_limit.zmax > 1.0 )
63 call_viewrep.clip_limit.zmax = ( float )1.0;
64 if( call_viewrep.clip_limit.zmin > call_viewrep.clip_limit.zmax )
66 call_viewrep.clip_limit.zmin = ( float )0.0;
67 call_viewrep.clip_limit.zmax = ( float )1.0;
70 call_viewrep.clip_xy = CALL_PHIGS_IND_NO_CLIP;
71 call_viewrep.clip_back = CALL_PHIGS_IND_NO_CLIP;
72 call_viewrep.clip_front = CALL_PHIGS_IND_NO_CLIP;
73 if( aview->Context.BackZClipping )
74 call_viewrep.clip_back = CALL_PHIGS_IND_CLIP;
75 if( aview->Context.FrontZClipping )
76 call_viewrep.clip_front = CALL_PHIGS_IND_CLIP;
78 if( (!wait) && (aview->WsId != -1) )
81 call_togl_viewmapping( aview, waitwait );
82 call_togl_vieworientation( aview, waitwait );
83 TelSetViewRepresentation( aview->WsId, aview->ViewId, &call_viewrep );
87 /*----------------------------------------------------------------------*/