1 /***********************************************************************
5 file OpenGl_togl_vieworientation.c :
12 HISTORIQUE DES MODIFICATIONS :
13 --------------------------------
14 xx-xx-xx : CAL ; Creation.
15 10-07-96 : FMN ; Suppression #define sur calcul matrice
17 ************************************************************************/
18 #define GER61454 //GG 14-09-99 Activates the model clipping planes
20 /*----------------------------------------------------------------------*/
25 #include <OpenGl_tgl_all.hxx>
26 #include <InterfaceGraphic_Graphic3d.hxx>
27 #include <InterfaceGraphic_Visual3d.hxx>
28 #include <OpenGl_tgl_vis.hxx>
29 #include <OpenGl_tgl_funcs.hxx>
31 /*----------------------------------------------------------------------*/
34 call_togl_vieworientation
36 CALL_DEF_VIEW * aview,
42 Tint err_ind; /* OUT error indicator */
47 Tfloat ScaleFactors[3];
51 Vrp[0] = aview->Orientation.ViewReferencePoint.x;
52 Vrp[1] = aview->Orientation.ViewReferencePoint.y;
53 Vrp[2] = aview->Orientation.ViewReferencePoint.z;
55 Vpn[0] = aview->Orientation.ViewReferencePlane.x;
56 Vpn[1] = aview->Orientation.ViewReferencePlane.y;
57 Vpn[2] = aview->Orientation.ViewReferencePlane.z;
59 Vup[0] = aview->Orientation.ViewReferenceUp.x;
60 Vup[1] = aview->Orientation.ViewReferenceUp.y;
61 Vup[2] = aview->Orientation.ViewReferenceUp.z;
63 ScaleFactors[0] = aview->Orientation.ViewScaleX;
64 ScaleFactors[1] = aview->Orientation.ViewScaleY;
65 ScaleFactors[2] = aview->Orientation.ViewScaleZ;
67 /* use user-defined matrix */
68 if ( aview->Orientation.IsCustomMatrix ) {
69 for( i = 0; i < 4; i++ )
70 for( j = 0; j < 4; j++ )
71 call_viewrep.orientation_matrix[i][j] = aview->Orientation.ModelViewMatrix[i][j];
74 TelEvalViewOrientationMatrix( Vrp, Vpn, Vup, ScaleFactors, &err_ind, call_viewrep.orientation_matrix);
76 if( !err_ind && aview->WsId != -1 )
78 call_viewrep.extra.vrp[0] = Vrp[0],
79 call_viewrep.extra.vrp[1] = Vrp[1],
80 call_viewrep.extra.vrp[2] = Vrp[2];
82 call_viewrep.extra.vpn[0] = Vpn[0],
83 call_viewrep.extra.vpn[1] = Vpn[1],
84 call_viewrep.extra.vpn[2] = Vpn[2];
86 call_viewrep.extra.vup[0] = Vup[0],
87 call_viewrep.extra.vup[1] = Vup[1],
88 call_viewrep.extra.vup[2] = Vup[2];
90 call_viewrep.extra.scaleFactors[0] = ScaleFactors[0],
91 call_viewrep.extra.scaleFactors[1] = ScaleFactors[1],
92 call_viewrep.extra.scaleFactors[2] = ScaleFactors[2];
97 call_togl_viewmapping( aview, waitwait );
98 call_togl_cliplimit( aview, waitwait );
100 call_togl_setplane( aview );
102 TelSetViewRepresentation( aview->WsId, aview->ViewId, &call_viewrep );
107 /*----------------------------------------------------------------------*/