C	TO TEST DATA STRUCTURE
	SUBROUTINE MASTER
	LOGICAL B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,LP
	INTEGER FIRST
	COMMON/OIL/IVECT(200)
	COMMON/EYCEP/EYE(3),CEN(3),UP(3)
	COMMON/LINKIT/ISTRT,LINKS(6,15)
	COMMON/LIMITS/XMIN,XMAX,YMIN,YMAX
	CALL CLEAR(.FALSE.)
	CALL DISPLY(0,500,IGET)
	ITAG=0
	LP=.FALSE.
	EYE(1)=0.
	EYE(2)=0.
	EYE(3)=45.
	CEN(1)=0.
	CEN(2)=0.
	CEN(3)=0.
	UP(1)=0.
	UP(2)=1.+CEN(2)
	UP(3)=0.
	DIST=40.
	XMIN=-30.
	XMAX=30.
	YMIN=-30.
	YMAX=30.
	IX=0
	IY=0
	CALL SETPEN(ITAG,LP,IX,IY)
	CALL BUTTON(1)
	CALL INITL
	CALL READIN
	CALL START
	MODULE=ISTRT
	CALL FILMOD(MODULE)
	NEW=1
	MODULE=ISTRT
	CALL DRAWIT(DIST,NEW,MODULE)
999	B1=.FALSE.
	B2=.FALSE.
	B3=.FALSE.
	B4=.FALSE.
	B5=.FALSE.
	B6=.FALSE.
	CALL BUTTON(3,B1,B2,B3,B4,B5,B6)
100	CALL BUTTON(2,B1)
	IF(B1)GO TO 5
	IF(LP)GO TO 25
	GO TO 100
5	CALL RESET
	MODULE=ISTRT
	CALL FILMOD(MODULE)
	CALL DRAWIT(DIST,NEW,MODULE)
	B1=.FALSE.
	CALL BUTTON(3,B1,B2,B3,B4,B5)
	GO TO 100
25	B5=.FALSE.
	B1=.FALSE.
	B2=.FALSE.
	B3=.FALSE.
	B4=.FALSE.
	LP=.FALSE.
	AN=5.
	CALL BUTTON(3,B1,B2,B3,B4,B5)
26	CALL BUTTON(2,B1,B2,B3,B4,B5,B6,B7)
	IF(B1)GO TO 27
	IF(B2)GO TO 28
	IF(B3)GO TO 29
	IF(B4)GO TO 40
	IF(B5)GO TO 50
	IF(B6)GO TO 999
	IF(B8)GO TO 666
	GO TO 26
27	RO=AN
	IF(B7)RO=-AN
	PI=0.
	YA=0.
	GO TO 30
28	RO=0.
	PI=AN
	IF(B7)PI=-AN
	YA=0.
	GO TO 30
29	RO=0.
	PI=0.
	YA=AN
	IF(B7)YA=-AN
30	MODL=ITAG
	CALL ROTATE(RO,PI,YA,MODL)
	CALL FILMOD(MODL)
	CALL DRAWIT(DIST,NEW,MODL)
	CALL PULSE(IDO,N)
	LP=.FALSE.
	GO TO 26
40	WRITE(4,425)
425	FORMAT(1X,25HDETECT MODULE TO BE MOVED)
41	IF(LP)GO TO 42
	GO TO 41
42	WRITE(4,426)ITAG
426	FORMAT(1X,6HMODULE,I3)
	WRITE(4,427)
427	FORMAT(1X,14HDX,DY,DZ 3F5.1)
	READ(4,525)DX,DY,DZ
525	FORMAT(3F5.1)
	MODL=ITAG
	CALL TRANS(DX,DY,DZ,MODL)
	CALL FILMOD(MODL)
	CALL DRAWIT(DIST,NEW,MODL)
	CALL PULSE(IDO,N)
	LP=.FALSE.
	B4=.FALSE.
	CALL BUTTON(3,B1,B2,B3,B4)
	GO TO 26
50	WRITE(4,450)
450	FORMAT(1X,26HDETECT MODULE TO BE SCALED)
51	IF(LP)GO TO 52
	GO TO 51
52	WRITE(4,451)ITAG
451	FORMAT(1X,6HMODULE,I3)
	WRITE(4,452)
452	FORMAT(1X,14HSX,SY,SZ 3F5.1)
	READ(4,550)SX,SY,SZ
550	FORMAT(3F5.1)
	MODL=ITAG
	CALL SCALE(SX,SY,SZ,MODL)
	CALL FILMOD(MODL)
	CALL DRAWIT(DIST,NEW,MODL)
	CALL PULSE(IDO,N)
	LP=.FALSE.
	B5=.FALSE.
	CALL BUTTON(3,B1,B2,B3,B4,B5)
	GO TO 26
666	CONTINUE
	PAUSE
	GO TO 25
	STOP
	END
