C*****************************************************************************
C  GEOM.FOR
C
C  This sample program demonstrates the use of the Device Info Functions.
C****************************************************************************
      include   "pgl.for"
      integer*2 j, ierr, pdata(12), polydata(12)
      data polydata/500,200, 100,400, 300,800,
     +              600,600, 900,700, 750,300/
C	
C	Open A Drawing File.
C	
	call pgInitDrw( "GEOM.PLT"//CHAR(0), 3001, 3001, ierr) 
      if( ierr .ne. 0)then
         print *, 'Error opening drawing file!'
         stop
      endif

      call pgSetTextStyle( pgTRIPLEX ) 
      call pgSetTextJustify( pgCENTER, pgBOTTOM ) 
      call pgSetCharSpacing( 3 )
      call pgSetTextScaling( 2,1,2,1 ) 
      call pgSetColor( 15 )
C
      call pgRectangle( 0, 0, 3000, 3000, pgOUTLINE ) 
      call pgLine( 0, 1000, 3000, 1000 ) 
      call pgLine( 0, 2000, 3000, 2000 ) 
      call pgLine( 1000, 0, 1000, 3000 ) 
      call pgLine( 2000, 0, 2000, 3000 ) 

C-------- 1 
      call pgArc( 500, 500, 300, 0, 210 ) 
      call pgDrawTextXY( 500, 990, "ARC"//CHAR(0)) 

C-------- 2 
      call pgSetFillStyle( 2, 1 ) 
      call pgCircle( 1500, 500, 300, pgOFILL ) 
      call pgDrawTextXY( 1500, 990, "CIRCLE"//CHAR(0)) 

C-------- 3 
      call pgEllArc( 2500, 500, 400, 300, 0, 210 ) 
      call pgDrawTextXY( 2500, 990, "ELLARC"//CHAR(0)) 

C------- 4 
      call pgSetFillStyle( 3, 1 ) 
      call pgEllipse( 500, 1500, 400, 300, pgOFILL ) 
      call pgDrawTextXY( 500, 1990, "ELLIPSE"//CHAR(0)) 

C------- 5 
      call pgSetFillStyle( 4, 1 ) 
      call pgPie( 1500, 1500, 300, 0, 240, pgOFILL ) 
      call pgDrawTextXY( 1500, 1990, "PIE"//CHAR(0)) 

C------- 6 
      do j = 1,12,2
        pdata(j)   = polydata(j)   + 2000 
        pdata(j+1) = polydata(j+1) + 1000 
      enddo
      call pgSetFillStyle( 5, 1 ) 
      call pgPolyLine( pdata, 6 ) 
      call pgDrawTextXY( 2500, 1990, "POLYLINE"//CHAR(0)) 

C------- 7 
      do j = 1,12,2
        pdata(j)   = polydata(j)   + 0 
        pdata(j+1) = polydata(j+1) + 2000 
      enddo
      call pgSetFillStyle( 6, 1 ) 
      call pgPolygon( pdata, 6, pgOFILL ) 
      call pgDrawTextXY( 500, 2990, "POLYGON"//CHAR(0)) 

C-------- 8 
      call pgSetFillStyle( 7, 1 ) 
      call pgRectangle( 1500-400, 2500-300, 1500+400, 2500+300,pgOFILL) 
      call pgDrawTextXY( 1500, 2990, "RECTANGLE"//CHAR(0)) 

C-------- 9 
      call pgSetFillStyle( 8, 1 ) 
      call pgSector( 2500, 2500, 400, 300, 0, 300, pgOFILL ) 
      call pgDrawTextXY( 2500, 2990, "SECTOR"//CHAR(0)) 
C
C      Close The Drawing File.
C	
      call pgEndDrw() 
C
      END
