h55697
s 00005/00007/00064
d D 1.2 83/03/31 12:34:21 mmm 2 1
c 
e
s 00071/00000/00000
d D 1.1 83/03/15 21:40:22 tes 1 0
c date and time created 83/03/15 21:40:22 by tes
e
u
4
U
t
T
I 1
subroutine gndcdc (xin, yin, xout, yout)
########################################################################
#                                                                      #
#          THIS MATERIAL IS CONFIDENTIAL AND IS FURNISHED UNDER        #
#          A WRITTEN LICENSE AGREEMENT.  IT MAY NOT BE USED,           #
#          COPIED OR DISCLOSED TO OTHERS EXCEPT IN ACCORDANCE          #
#          WITH THE TERMS OF THAT AGREEMENT.                           #
#                                                                      #
#          COPYRIGHT (C) 1982 GRAPHIC SOFTWARE SYSTEMS INC.            #
#          ALL RIGHTS RESERVED.                                        #
#                                                                      #
#          COPYRIGHT (C) 1981 GRAPHIC SOFTWARE SYSTEMS INC.            #
#          ALL RIGHTS RESERVED.                                        #
#                                                                      #
#     Function: transform a point from NDC space to the device coord.  #
#                                                                      #
#     Input Parameters:                                                #
#            xin - x ndc coordinate                                    #
#            yin - y ndc coordinate                                    #
#                                                                      #
#     Output Parameters:                                               #
#            xout - x 2D world coordinate                              #
#            yout - y 2D world coordinate                              #
#                                                                      #
#     Routines Called:                                                 #
#            gzmtml - matrix multiplier                                #
#            gzwktn - update modeling and viewing transform            #
#                                                                      #
########################################################################
real xin, yin, xout, yout
 
real temp1(3), temp11, temp12, temp13,
     temp2(3), temp21, temp22, temp23,
D 2
     tempx, tempy
E 2
I 2
     tempx, tempy, gtreal 
E 2

D 2
REALS GETREAL

E 2
include(`gkscom')
 
equivalence (temp1(1), temp11), (temp1(2), temp12), (temp1(3), temp13),
            (temp2(1), temp21), (temp2(2), temp22), (temp2(3), temp23)
 
#    temp1(3)
data temp13 /1.0/
 
   if (nwkvw == 1) call gzwktn
 
   #   temp1(1) = xin
   #   temp1(2) = yin
D 2
   temp11 = GETREAL(xin)
   temp12 = GETREAL(yin)
E 2
I 2
   temp11 = gtreal (xin, 0)
   temp12 = gtreal (yin, 0)
E 2
 
   call gzmtml (1,3,3,temp1,wkview,temp2)

   #   xout = temp2(1)
   #   yout = temp2(2)

   # Convert from 32k space to device rasters
   tempx = temp21 * (float(mxdsdc(1))+1.0) / 32768.0
   tempy = temp22 * (float(mxdsdc(2))+1.0) / 32768.0
   
   if (devcor == METERS) { # convert from raster to meters
      tempx = tempx * sptszx       
      tempy = tempy * sptszy       
      }
   
D 2
   PUTREAL(tempx,xout)
   PUTREAL(tempy,yout)
E 2
I 2
   call ptreal (tempx, 0, xout)
   call ptreal (tempy, 0, yout)
E 2

   return
end
E 1
