OCC22105 Suspicious call to XOpenDisplay() in OSD_FontMgr class
[occt.git] / src / OpenGl / OpenGl_togl_unproject_raster.cxx
CommitLineData
7fd59977 1/***********************************************************************
2
3FONCTION :
4----------
5File OpenGl_togl_unproject_raster :
6
7
8REMARQUES:
9----------
10
11
12HISTORIQUE DES MODIFICATIONS :
13--------------------------------
1424-05-96 : CAL ; Creation
15
16************************************************************************/
17
18/*----------------------------------------------------------------------*/
19/*
20* Includes
21*/
22#include <OpenGl_tgl_all.hxx>
23#include <OpenGl_telem_util.hxx>
24
25int EXPORT
26call_togl_unproject_raster
27(
28 int wsid,
29 int xm,
30 int ym,
31 int xM,
32 int yM,
33 int ixr,
34 int iyr,
35 float *x,
36 float *y,
37 float *z
38 )
39{
40 TStatus result;
41 Tint xr, yr;
42
43 xr = ixr;
44 /*
45 Patched by P.Dolbey: the window pixel height decreased by one
46 in order for yr to remain within valid coordinate range [0; Ym -1]
47 where Ym means window pixel height.
48 */
49 yr = (yM-1)-ym-iyr;
50 result = TelUnProjectionRaster (wsid, xr, yr, x, y, z);
51
52 if (result == TSuccess)
53 return (0);
54 else
55 return (1);
56}
57
58int EXPORT
59call_togl_unproject_raster_with_ray
60(
61 int wsid,
62 int xm,
63 int ym,
64 int xM,
65 int yM,
66 int ixr,
67 int iyr,
68 float *x,
69 float *y,
70 float *z,
71 float *dx,
72 float *dy,
73 float *dz
74 )
75{
76 TStatus result;
77 Tint xr, yr;
78
79 xr = ixr;
80 yr = yM-ym-iyr;
81 result = TelUnProjectionRasterWithRay (wsid, xr, yr, x, y, z, dx, dy, dz);
82
83 if (result == TSuccess)
84 return (0);
85 else
86 return (1);
87}