5 * Revision 1.1.1.1 1995/10/24 10:20:20 cernlib
9 #include "geant321/pilot.h"
10 *CMZ : 3.21/02 29/03/94 15.41.25 by S.Giani
12 SUBROUTINE GDCGCL(ISHAPE)
14 C. ******************************************************************
16 C. * This Subroutine allows the clipping of a CG object *
17 C. * built with the Hidden Line Removal by means of any *
18 C. * kind of shape (moreover it's possible to clip the *
19 C. * same object more than once and by different shapes) *
20 C. * defined by 'MCVOL' Command. *
22 C. * ==>Called by : GDCGHI *
24 C. * Authors : J.Salt ; S.Giani ********* *
26 C. ******************************************************************
28 #include "geant321/gcbank.inc"
29 #include "geant321/gcgobj.inc"
30 #include "geant321/gchiln.inc"
31 #include "geant321/gcspee.inc"
32 #include "geant321/gcmutr.inc"
34 DIMENSION VMIN(3),VMAX(3)
37 * Volume substraction. The algorithm is the following :
39 * Check if the Clipping volume is inside Volume 'I' (First Check)
41 * a) If Yes , Volume 'I' is Seen (IVFUN=1)
42 * b) If Not , Check the following 3 cases (Second Check):
44 * 1) C. Vol. intersects volume 'I', but the volume does not include it
46 * 2) Volume 'I' is inside C. Vol., Then Volume is Unseen (IVFUN=0)
47 * 3) Volume 'I' is outside C. Vol., Then Volume is Seen (IVFUN=1)
53 CALL CGMNMX(Q(IA),VMIN,VMAX)
61 IF(ISHAPE.EQ.29.OR.ISHAPE.EQ.99)THEN
62 CALL CGCOPY(Q(IB),8000,Q(ISUB))
64 CALL CGCOPY(Q(IA),8000,Q(ISUB))
69 * Do it for all the volumes cutting 'I'
73 IF(VMIN(K).LE.BMIN(K+3*IJ-3).AND.BMIN(K+3*IJ-3).LE.VMAX(K).AND.
74 +VMIN(K).LE.BMAX(K+3*IJ-3).AND.BMAX(K+3*IJ-3).LE.VMAX(K))THEN
84 * C. Vol. is not inside 'I' Volume. Second Check:
91 * Do it for all the volumes cutting 'I'
93 IF(BMIN(J+3*IJ-3).LE.VMIN(J).AND.VMIN(J).LE.BMAX(J+3*IJ-3))THEN
98 IF(BMIN(J+3*IJ-3).LE.VMAX(J).AND.VMAX(J).LE.BMAX(J+3*IJ-3))THEN
104 IF(IDISJ.EQ.6)GOTO 40
106 40 IF(IDISJ.EQ.6)THEN
121 ** IF(IVFUN.EQ.0)GOTO 11
125 * Multiple clipping: you can clip, as a sequence, the same
126 * volume by two different shapes
132 IF(ISHAPE.EQ.29.OR.ISHAPE.EQ.99)THEN
133 IF(IVFUN.EQ.2) CALL CGSUB(Q(IB),Q(ICLIP1),8000,Q(ISUB1))
134 IF(IVFUN.EQ.1) CALL CGCOPY(Q(IB),8000,Q(ISUB1))
136 IF(IVFUN.EQ.2) CALL CGSUB(Q(IA),Q(ICLIP1),8000,Q(ISUB1))
137 IF(IVFUN.EQ.1) CALL CGCOPY(Q(IA),8000,Q(ISUB1))
141 IF(IVFUN.EQ.2) CALL CGSUB(Q(ISUB1),Q(ICLIP2),8000,Q(ISUB))
142 IF(IVFUN.EQ.1) CALL CGCOPY(Q(ISUB1),8000,Q(ISUB))
146 IF(ISHAPE.EQ.29.OR.ISHAPE.EQ.99)THEN
147 IF(IVFUN.EQ.2) CALL CGSUB(Q(IB),Q(ICLIP1),8000,Q(ISUB))
148 IF(IVFUN.EQ.1) CALL CGCOPY(Q(IB),8000,Q(ISUB))
150 IF(IVFUN.EQ.2) CALL CGSUB(Q(IA),Q(ICLIP1),8000,Q(ISUB))
151 IF(IVFUN.EQ.1) CALL CGCOPY(Q(IA),8000,Q(ISUB))