.MCALL .MODULE .MODULE GPM,RELEASE=V00,VERSION=30,COMMENT= .ENABLE LC,LSB .NLIST CND ;+ ;************************************************************************ ;*.ST POLYMARKER * ;*.PAGE * ;*.X POLYMARKER * ;*.X GPM * ;*.LIT * ;************************************************************************ ;* * ;* FORTRAN calling sequence: * ;* SUBROUTINE GPM (N, PX, PY) * ;* * ;* Input parameters: * ;* INTEGER N number of points * ;* REAL PX(N), PY(N) coordinates of points in world * ;* coordinates * ;* * ;************************************************************************ ;*.ELI * ;************************************************************************ ;- .LIBRARY /GKS.MLB/ .MCALL $GKS $GKS .LIBRARY /CGI.MLB/ .MCALL $CGI $CGI .LIBRARY /UTL.MLB/ .MCALL $UTL $UTL .NLIST .INCLUDE /GOPSTA.INC/ .INCLUDE /GKSSL.INC/ .INCLUDE /CGIVTD.INC/ .INCLUDE /GERROR.INC/ .LIST .PSECT G$$COD,RW,I,LCL,REL,CON GPM:: PUSH R5 ; Save the argument pointer. $FORALLWS PUSH R2 $VMT R2,#GS.CMT ; Set the Marker type. MOV (SP),R2 $VMC R2,#GS.PCI ; Set the PolyMarker Colour Index. POP R2 $ENDFOR POP R5 ; Restore the argument pointer. MOV @2(R5),NMBPTS ; Get the number of points to draw. .PAGE .SBTTL Select the right Normalization Transform MOV GS.LNT,R1 MOV GS.CNT,R0 10$: TST R0 ; Is this the right N.T.? BLE 20$ ; Branch if it is. ADD #NTSIZE,R1 ; Skip over this N.T. DEC R0 BR 10$ ; Keep looking. .PAGE .SBTTL Perform the Normalization Transform 20$: ADD #INTSIZ,R1 ; Skip over the N.T. number. MOV 4(R5),R2 ; Get the X array address. MOV 6(R5),R3 ; Get the Y array address. PUSH R1,R2,R3 30$: POP R3,R2,R1 MOV #PNT,R4 ; Address of the first point. 40$: MOVFLT (R2)+,(R4)+ ; Get the X value. MOVFLT (R3)+,(R4)+ ; Get the Y value. PUSH R1,R2,R3 50$: CALL NTRANS,R1,#PNT,#NPNT ; Transform one point. .PAGE .SBTTL Clip Points as Necessary CMP GS.CI,#GCLIP ; Is CLIP on? BNE 60$ ; Branch if not. CALL CLIPCD,#NPNT,#,GS.CR TST R0 ; Inside the clip rectangle? BNE 70$ ; Branch if not. 60$: $FORALLWS $VPM R2,#1,#NPNT ; Draw the marker. $ENDFOR 70$: DEC NMBPTS ; Decrement the counter. BGT 30$ ; Branch if more points. 80$: POP R3,R2,R1 RTS PC ; Return. .PAGE .SBTTL Coordinate Transformation Work Area .PSECT G$$TRN,RW,D,GBL,REL,OVR CPNT: PNT: .FLT2 0.0,0.0 NPNT: .FLT2 0.0,0.0 NMBPTS: .WORD 0 ; Counter for number of points. .END