perm filename GEOMES.OLD[GEM,BGB] blob sn#038351 filedate 1973-06-17 generic text, type T, neo UTF8
COMMENT ⊗   VALID 00006 PAGES 
RECORD PAGE   DESCRIPTION
 00001 00001
 00002 00002	REQUIRE "⊂⊃⊂⊃" DELIMITERS
 00004 00003	WINGS
 00006 00004	EULER
 00008 00005	IO, VIEWER AND OCCULT
 00010 00006	WORLD LOCUS
 00013 ENDMK
⊗;
REQUIRE "⊂⊃⊂⊃" DELIMITERS;

IFC ¬DECLARATION(BUILD_GEMREL) THENC
 	DEFINE BUILD_GEMREL=0; 
	REQUIRE "GEMREL.REL[GEM,BGB]" LOAD_MODULE;
ELSEC

COMMENT WE ARE MAKING A SUPER INTERFACE REL FILE;

COMMENT LOAD GEOMES AND FRIENDS;

	REQUIRE "GEOMES.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "WINGS.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "EULER.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "BIN.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "EUCLID.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "VIEWER.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "OCCULT.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "REVEAL.REL[GEM,BGB]" 	LOAD_MODULE;
	REQUIRE "IO.REL[GEM,BGB]" 	LOAD_MODULE;
ENDC

COMMENT THE MACRO XCALL(NAME,ARGS);
DEFINE XCALL(NAME,ARGS)=
IFC BUILD_GEMREL THENC
⊂ DEFINE _NAME="_"&"NAME";
	INTERNAL SIMPLE INTEGER PROCEDURE _NAME ARGS;
	BEGIN
		EXTERNAL SIMPLE INTEGER PROCEDURE NAME;
	START_CODE
		MOVEM '12,BGB12;
		MOVEM '16,BGB16;
		POP   '17,BGBRET;
		PUSHJ '17,NAME;
		MOVE  '12,BGB12;
		MOVE  '16,BGB16;
		JRST  @BGBRET;
	END;
	END;
		DEFINE NAME="_"&"NAME"
⊃;
ELSEC
⊂ DEFINE _NAME="_"&"NAME";
	EXTERNAL SIMPLE INTEGER PROCEDURE _NAME ARGS;
	DEFINE NAME="_"&"NAME"
⊃;
ENDC


	DEFINE XSUBR=⊂EXTERNAL INTEGER SIMPLE PROCEDURE⊃;
COMMENT WINGS;
	XSUBR MKNODE(INTEGER TYP);
	XSUBR KLNODE(INTEGER NOD);

	XSUBR MKWORLD;
	XSUBR MKWINDOW;
	XSUBR MKCAMERA;
	XSUBR MKFRAME; 

	XSUBR MKB(INTEGER WORLD);
	XSUBR KLB(INTEGER BNEW);
	XSUBR KLBFEV(INTEGER Q);

	XSUBR MKF(INTEGER B);
	XSUBR MKE(INTEGER B);
	XSUBR MKV(INTEGER B);

	XSUBR WING(INTEGER E1,E2); 
	XSUBR LINKED(INTEGER Q1,Q2); 

	XSUBR ECW(INTEGER Q1,Q2); 
	XSUBR ECCW(INTEGER Q1,Q2); 
	XSUBR OTHER(INTEGER Q1,Q2); 

	XSUBR BGET(INTEGER Q); 
	XSUBR BDET(INTEGER Q1,Q2);
	XSUBR BATT(INTEGER Q1,Q2);

	XSUBR VCW(INTEGER E,F); 
	XSUBR VCCW(INTEGER E,F); 
	XSUBR FCW(INTEGER E,V); 
	XSUBR FCCW(INTEGER E,V); 
COMMENT EULER;

	XCALL(⊂INVERT⊃,⊂(INTEGER E)⊃);
	XCALL(⊂EVERT⊃,⊂(INTEGER B)⊃);

	XCALL(⊂MKEV⊃,⊂(INTEGER F,V)⊃);
	XCALL(⊂MKFE⊃,⊂(INTEGER V1,F,V2)⊃);
	XCALL(⊂ESPLIT⊃,⊂(INTEGER E)⊃);

	XCALL(⊂KLFE⊃,⊂(INTEGER E)⊃);
	XCALL(⊂KLEV⊃,⊂(INTEGER V)⊃);
	XCALL(⊂KLVE⊃,⊂(INTEGER E)⊃);

	XCALL(⊂MKCOPY⊃,⊂(INTEGER B)⊃);
	XCALL(⊂GLUEE⊃,⊂(INTEGER F1,V1,F2,V2)⊃);
	XCALL(⊂GLUE⊃,⊂(INTEGER F1,F2)⊃);

	XCALL(⊂SWEEP⊃,⊂(INTEGER FCE,FLG)⊃);
	XCALL(⊂ROTCOM⊃,⊂(INTEGER F)⊃);
	XCALL(⊂PYRAMID⊃,⊂(INTEGER FV)⊃);
	XCALL(⊂REMOVF⊃,⊂(INTEGER F)⊃);
	XCALL(⊂FVDUAL⊃,⊂(INTEGER B)⊃);
	XCALL(⊂MKCUBE⊃,⊂(REAL A,B,C)⊃);

COMMENT EUCLID;

	XCALL(⊂TRANSLATE⊃,⊂(INTEGER OBJECT;REAL DX,DY,DZ)⊃);
	XCALL(⊂ROTATE⊃,⊂(INTEGER OBJECT;REAL ABOUTX,ABOUTY,ABOUTZ)⊃);
	XCALL(⊂SHRINK⊃,⊂(INTEGER OBJECT;REAL SCALEX,SCALEY,SCALEZ)⊃);
	XCALL(⊂NORM⊃,⊂(INTEGER L)⊃);
	XCALL(⊂ORTHO1⊃,⊂(INTEGER L)⊃);
	XCALL(⊂DISTAN⊃,⊂(INTEGER V1,V2)⊃);
	XCALL(⊂APTRAN⊃,⊂(INTEGER OBJECT,ETRAN)⊃);
	XCALL(⊂INTRAN⊃,⊂(INTEGER ETRAN)⊃);
COMMENT IO, VIEWER AND OCCULT;

	XCALL(⊂IFORM1⊃,⊂⊃);
	XCALL(⊂OFORM1⊃,⊂(INTEGER B)⊃);
	
	XCALL(⊂SHOW1⊃,⊂(INTEGER WINDOW,GLASS)⊃);
	XCALL(⊂SHOW2⊃,⊂(INTEGER WINDOW,GLASS)⊃);

	XCALL(⊂PPROJ⊃,⊂(INTEGER CAMERA,WORLD)⊃);
	XCALL(⊂EMRKALL⊃,⊂(INTEGER WORLD)⊃);
	XCALL(⊂EMRK⊃,⊂(INTEGER WORLD)⊃);
	XCALL(⊂FMRK⊃,⊂(INTEGER WORLD)⊃);
	XCALL(⊂OCCULT⊃,⊂(INTEGER WORLD)⊃);

	XCALL(⊂KLJUTS⊃,⊂(INTEGER WORLD)⊃);
	XCALL(⊂KLJOTS⊃,⊂(INTEGER WORLD)⊃);
	XCALL(⊂KLTMPS⊃,⊂(INTEGER WORLD)⊃);
	XCALL(⊂CLIPER⊃,⊂(INTEGER WINDOW)⊃);
	XCALL(⊂IIIDPY⊃,⊂(INTEGER WINDOW,GLASS)⊃);

	XCALL(⊂BIN⊃,⊂(INTEGER B1,B2)⊃);
	XCALL(⊂BUN⊃,⊂(INTEGER B1,B2)⊃);
	XCALL(⊂BSUB⊃,⊂(INTEGER B1,B2)⊃);
COMMENT WORLD LOCUS;
	DEFINE XWC(V)=⊂MEMORY[V-3,REAL]⊃;
	DEFINE YWC(V)=⊂MEMORY[V-2,REAL]⊃;
	DEFINE ZWC(V)=⊂MEMORY[V-1,REAL]⊃;

COMMENT ROTATION MATRIX;
	DEFINE IX(V)=⊂MEMORY[V+0,REAL]⊃;
	DEFINE IY(V)=⊂MEMORY[V+1,REAL]⊃;
	DEFINE IZ(V)=⊂MEMORY[V+2,REAL]⊃;
	DEFINE JX(V)=⊂MEMORY[V+3,REAL]⊃;
	DEFINE JY(V)=⊂MEMORY[V+4,REAL]⊃;
	DEFINE JZ(V)=⊂MEMORY[V+5,REAL]⊃;
	DEFINE KX(V)=⊂MEMORY[V+6,REAL]⊃;
	DEFINE KY(V)=⊂MEMORY[V+7,REAL]⊃;
	DEFINE KZ(V)=⊂MEMORY[V+8,REAL]⊃;

COMMENT PERSPECTIVE-PROJECTED LOCUS;
	DEFINE XPP(V)=⊂MEMORY[V+4,REAL]⊃;
	DEFINE YPP(V)=⊂MEMORY[V+5,REAL]⊃;
	DEFINE ZPP(V)=⊂MEMORY[V+6,REAL]⊃;

COMMENT FACE, EDGE AND VERTEX RINGS;
	DEFINE H1(X)=⊂ (X LSH -18)⊃;
	DEFINE H2(X)=⊂ (X LAND '777777)⊃;
	DEFINE NFACE(E)=⊂H1(MEMORY[E+1])⊃;
	DEFINE PFACE(E)=⊂H2(MEMORY[E+1])⊃;
	DEFINE NED(E)=⊂H1(MEMORY[E+2])⊃;
	DEFINE PED(E)=⊂H2(MEMORY[E+2])⊃;
	DEFINE NVT(E)=⊂H1(MEMORY[E+3])⊃;
	DEFINE PVT(E)=⊂H2(MEMORY[E+3])⊃;

COMMENT PARTS' TREE LINKS;
	DEFINE DAD(B)=⊂H1(MEMORY[B+4])⊃;
	DEFINE SON(B)=⊂H2(MEMORY[B+4])⊃;
	DEFINE BRO(B)=⊂H1(MEMORY[B+5])⊃;
	DEFINE SIS(B)=⊂H2(MEMORY[B+5])⊃;

COMMENT MULTI PURPOSE LINKS;
	DEFINE ALT(B)=⊂H1(MEMORY[B+6])⊃;
	DEFINE ALT2(B)=⊂H2(MEMORY[B+6])⊃;
	DEFINE FRAME(B)=⊂H2(MEMORY[B+6])⊃;
	DEFINE CW(B)=⊂H1(MEMORY[B+7])⊃;
	DEFINE CCW(B)=⊂H2(MEMORY[B+7])⊃;
	DEFINE CAR8(B)=⊂H1(MEMORY[B+8])⊃;
	DEFINE CDR8(B)=⊂H2(MEMORY[B+8])⊃;

REQUIRE UNSTACK_DELIMITERS;