This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gdraw / gviewf.F
1 *
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.1.1.1  1995/10/24 10:20:30  cernlib
6 * Geant
7 *
8 *
9 #include "geant321/pilot.h"
10 *CMZ :  3.21/02 29/03/94  15.41.28  by  S.Giani
11 *-- Author :
12       SUBROUTINE GVIEWF(U,V,NP)
13 C.
14 C.    ******************************************************************
15 C.    *                                                                *
16 C.    *       Draw the polyline described by U and V vectors,          *
17 C.    *       of length NP.                                            *
18 C.    *                                                                *
19 C.    *       Depending on IDVIEW it draws on screen (IDVIEW=0)        *
20 C.    *       or stores in the current view bank (IDVIEW>0).           *
21 C.    *                                                                *
22 C.    *       In LINATT (common GCDRAW) there is                       *
23 C.    *       a bit mask for the line attributes :                     *
24 C.    *                                                                *
25 C.    *       Bit  1- 7 = Used by view bank (LENGU)                    *
26 C.    *       Bit  8-10 = Line width                                   *
27 C.    *       Bit 11-13 = Line style                                   *
28 C.    *       Bit 14-16 = Fill area                                    *
29 C.    *       Bit 17-24 = Line color                                   *
30 C.    *                                                                *
31 C.    *    ==>Called by : GDRAWV                                       *
32 C.    *       Author : P.Zanarini ; S.Giani  *********                 *
33 C.    *                                                                *
34 C.    ******************************************************************
35 C.
36 #include "geant321/gcbank.inc"
37 #include "geant321/gcdraw.inc"
38 #include "geant321/gcunit.inc"
39 #include "geant321/gcflag.inc"
40 #include "geant321/gcspee.inc"
41       DIMENSION U(*),V(*)
42       SAVE LFILOL
43       DATA LFILOL/-1/
44 C.
45 C.    ------------------------------------------------------------------
46 C.
47 C
48 C             Store on view bank IDVIEW
49 C
50       JV=LQ(JDRAW-IDVIEW)
51       IGU=IGU+1
52 C
53    10 IF (IGU.LE.MAXGU) GO TO 20
54 C
55 C             Push graphic unit banks
56 C
57       IF(MORGU.EQ.0)MORGU=100
58       MORPUS=MAX(MORGU,MAXGU/4)
59       JV = LQ(JV-1)
60       CALL MZPUSH(IXCONS,JV,0,MORPUS,'I')
61       IF(IEOTRI.NE.0)GO TO 40
62       JV=LQ(JDRAW-IDVIEW)
63       JV = LQ(JV-2)
64       CALL MZPUSH(IXCONS,JV,0,MORPUS,'I')
65       IF(IEOTRI.NE.0)GO TO 40
66       JV=LQ(JDRAW-IDVIEW)
67       MAXGU=MAXGU+MORPUS
68       GO TO 10
69 C
70    20 IF ((IGS+NP).LE.MAXGS) GO TO 30
71 C
72 C             Push graphic segment banks
73 C
74       IF(MORGS.EQ.0)MORGS=100
75       MORPUS=MAX(MORGS,MAXGS/4,NP)
76       JV = LQ(JV-4)
77       CALL MZPUSH(IXCONS,JV,0,MORPUS,'I')
78       IF(IEOTRI.NE.0)GO TO 40
79       JV=LQ(JDRAW-IDVIEW)
80       JV = LQ(JV-5)
81       CALL MZPUSH(IXCONS,JV,0,MORPUS,'I')
82       IF(IEOTRI.NE.0)GO TO 40
83       JV=LQ(JDRAW-IDVIEW)
84       MAXGS=MAXGS+MORPUS
85 *
86       GO TO 20
87 C
88    30 CONTINUE
89       Q(JV+13)=GTHETA
90       Q(JV+14)=GPHI
91       Q(JV+15)=GPSI
92       Q(JV+16)=GU0
93       Q(JV+17)=GV0
94       Q(JV+18)=GSCU
95       Q(JV+19)=GSCV
96       JV1=LQ(JV-1)
97       JV2=LQ(JV-2)
98       JV4=LQ(JV-4)
99       JV5=LQ(JV-5)
100 *
101       CALL UCOPY(U,Q(JV4+IGS+1),NP)
102       CALL UCOPY(V,Q(JV5+IGS+1),NP)
103 C
104 C             Bit 1- 7 = LENGU
105 C             Bit 8-24 = Line attribute
106 C
107       ISUM=0
108       CALL MVBITS(LINATT,0,24,ISUM,0)
109       CALL MVBITS(NP,0,10,ISUM,0)
110       Q(JV1+IGU)=ISUM
111 C
112       Q(JV2+IGU)=IGS+1
113       IGS=IGS+NP
114       GO TO 999
115 C
116    40 WRITE (CHMAIL,10000)
117       CALL GMAIL(0,0)
118 C
119 10000 FORMAT (' *** GVIEWF ***: Memory overflow in pushing a bank')
120   999 END