]> git.uio.no Git - u/mrichter/AliRoot.git/blob - GEANT321/gdraw/gdinit.F
This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gdraw / gdinit.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:23  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.26  by  S.Giani
11 *-- Author :
12       SUBROUTINE GDINIT
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Initialize the drawing package                           *
17 C.    *                                                                *
18 C.    *    ==>Called by : <USER>  UGINIT                               *
19 C.    *       Author : P.Zanarini ; S.Giani   *********                *
20 C.    *                                                                *
21 C.    ******************************************************************
22 C.
23 #include "geant321/gcbank.inc"
24 #include "geant321/gcflag.inc"
25 #include "geant321/gcdraw.inc"
26 #include "geant321/gconsp.inc"
27 #include "geant321/gcgobj.inc"
28 #include "geant321/gcmutr.inc"
29 #include "geant321/gcspee.inc"
30       COMMON/INIFIR/NFIRST
31       DIMENSION GR0(10),GT0(3)
32 #if defined(CERNLIB_CG)
33       DIMENSION     V(3),T(4,3)
34 #endif
35 C
36       SAVE GR0,GT0
37       DATA GR0/1.,0.,0.,0.,1.,0.,0.,0.,1.,0./
38       DATA GT0/0.,0.,0./
39 C.
40 C.    ------------------------------------------------------------------
41 C.
42 C             Initialize general drawing parameters:
43 C
44 C             NGVIEW = Flag for GDFR3D, set to 0 if one wants GDFR3D to
45 C                      compute new transformation matrix
46 C             NKVIEW = Total number of view banks
47 C             IDVIEW = Actual view bank (0 means screen)
48 C             GTHETA,GPHI,...,GSCV = Initial values for GDRAW calling parameters
49 C             GZUA,GZVA,GZUB,GZVB,GZUC,GZVC = Zoom parameters
50 C             DPERS  = Distance from the center of projection
51 C                      (i.e. viewing position) at Z=-DPERS
52 C                      and the projection plane at Z=0
53 C             LINBUF = Flag to determine if GDRAWV has to perform
54 C                      line buffering logic (LINBUF=1) or not
55 C             IPIONS = Flag for GDFR3D, set to 1 if PIONS is used
56 C             IGMR   = Flag for GDFR3D, set to 1 if APOLLO-GMR is used
57 C             IPKHIT = Flag for GPHITS (normally 0); if >0 then print only
58 C                      hit nr. IPKHIT
59 C             IDRNUM = Flag for GDRAW, set to 1 when called by GDRVOL
60 C             PLTRNX = Screen and plotter X range, PLTRNX x PLTRNY cm.
61 C             PLTRNY = Screen and plotter Y range, PLTRNX x PLTRNY cm.
62 ***           RNGU1,RNGU2,RNGV1,RNGV2 = Limits of user coordinates (2D window)
63 C
64       IF(IFINIT(14).NE.0)RETURN
65       IFINIT(14)=1
66       NFIRST=0
67       NGVIEW=0
68       NKVIEW = 0
69       IDVIEW= 0
70       GTHETA=45.
71       GPHI=135.
72       GPSI=0.
73       GU0=10.
74       GV0=10.
75       GSCU=0.015
76       GSCV=0.015
77       SINPSI=SIN(GPSI*DEGRAD)
78       COSPSI=COS(GPSI*DEGRAD)
79       GZUA=1
80       GZVA=1
81       GZUB=0
82       GZVB=0
83       GZUC=0
84       GZVC=0
85       DPERS=1000
86       LINBUF=0
87       IPIONS=0
88       IGMR=0
89       IPKHIT=0
90       IDRNUM=0
91       PLTRNX=20.
92       PLTRNY=20.
93 C
94 C             LINATT = Current line attributes
95 C             LINATP = Permanent line attributes
96 C             ITXATT = Current text attributes
97 C
98       LINCOL=1
99       LINWID=1
100       LINSTY=1
101       LINFIL=0
102       LEP=1
103 C
104       LINATT=0
105       CALL MVBITS(LINCOL,0,8,LINATT,16)
106       CALL MVBITS(LINWID,0,3,LINATT,7)
107       CALL MVBITS(LINSTY,0,3,LINATT,10)
108       CALL MVBITS(LINFIL,0,3,LINATT,13)
109 C
110       LINATP=LINATT
111 C
112       ITXWID=1
113       ITXCOL=1
114 C
115       ITXATT=0
116       CALL MVBITS(ITXWID,0,3,ITXATT,0)
117       CALL MVBITS(ITXCOL,0,4,ITXATT,3)
118 C
119 C             Initialize drawing options:
120 C
121 C             ITR3D  = Flag for GDFR3D : ITR3D=0 for standard projection,
122 C                      ITR3D <> 0 for rotation + projection i.e. R-Z projection
123 C                      (refer to the header comments of GDFR3D
124 C                      to have a detailed explanation of the steps
125 C                      from 3D to 2D)
126 C
127 C             ITHRZ  = Flag for GDHITS/GDCXYZ/GDXYZ : if not set to 'OFF ' all t
128 C                      hits and tracks drawing routines will apply an R-Z
129 C                      projection in case of SIDE or TOP view
130 C
131 C             IOBJ   = Type of object being currently drawn :
132 C
133 C                         1 : VOLUME
134 C                         2 : TRACK
135 C                         3 : HIT
136 C                         0 : None or any other object (axes,header,text,etc.)
137 C
138 C             IPRJ   = Flag for GDFR3D :
139 C
140 C                      'PARA' : Ortographic parallel projection (default)
141 C                      'PERS' : Perspective projection
142 C
143 C             ITRKOP = Flag for GDXYZ :
144 C
145 C                      'LINE' : Lines joining track points are drawn
146 C                      'POIN' : Only the track points are drawn
147 C
148       ITR3D=0
149       CALL UCTOH('OFF ',ITHRZ,4,4)
150       IOBJ=0
151       CALL UCTOH('PARA',IPRJ,4,4)
152       CALL UCTOH('LINE',ITRKOP,4,4)
153       CALL UCTOH('OFF ',IHIDEN,4,4)
154 C
155 C             Initialize Color look up table
156 C
157       DO 10 I=1,16
158   10  LOOKTB(I)=I
159 C
160 C             Define tree parameters:
161 C
162 C             NWCUT = Max words allocated to be used by the cut routines
163 C
164       NWCUT=5000
165 C
166 C             Initialize to unitary transformation
167 C
168       DO 20 I=1,3
169    20 GTRAN0(I)=GT0(I)
170       DO 30 I=1,10
171    30 GRMAT0(I)=GR0(I)
172 C
173 C             Set display and user coordinate systems
174 C
175       CALL ISWN(1,0.,PLTRNX,0.,PLTRNY)
176       CALL ISVP(1,0.,1.,0.,1.)
177       CALL IGSET('TXFP',-61.)
178       CALL IGRNG(PLTRNX,PLTRNY)
179       CALL IGSA(0)
180 *JS
181 *
182 *  Setting the Viewing parameters to THETA =0., PHI=0., PSI=0.
183 *
184 #if defined(CERNLIB_CG)
185       NCVOLS=0
186       NSHIFT=0
187       KSHIFT=0
188       IHOLE=0
189       CGXMIN=-10000.
190       CGXMAX=-9999.
191       CGYMIN=-10000.
192       CGYMAX=-9999.
193       CGZMIN=-10000.
194       CGZMAX=-9999.
195       V(1)=0.
196       V(2)=0.
197       V(3)=0.
198       CALL GDCGVW(V,T)
199       CALL CGTSET(NTRCG,T,IREP)
200 #endif
201 *JS
202 C
203 C             Book JDRAW structure for view banks
204 C
205       IF (JDRAW.LE.0) CALL MZBOOK(IXCONS,JDRAW,JDRAW,1,'DRAW',0,0,0,3,0)
206 C
207       END
208