Previous Next Up Title Contents Index Functions Index Top Library

1.7.5. DRAWING A CIRCLE WITH 2 LINEAR AXES, AND GENERATING A POSTSCRIPT FILE

	program p75
	include 'PHIGS.H'

	integer circid, wkid,wkip, viewid, scenid,xaxid,yaxid, listid(3)
	real viewpt(4)
	data wkid,wkip, viewid, scenid, circid / 1,2, 1, 10, 11 /
	data xaxid,yaxid, listid /12,13, 11,12,13/
	data zoom, radius, xc,yc   / 0.8, 5.0, 15.,15. /
	data xmin,ymin, xmax,ymax  / 10.,10.,20.,20. /
	data viewpt /0.,1., 0.,1./

c---------------------------------------------------------------------

c	open PHIGURE and and a X-window type workstation (8887)*/
	call topph (6)
	call topwk (wkid,30,8887)

c	define 2D working domain
	call tdoma2 (xmin,ymin, xmax,ymax)

c	build 2 axes
	call taxyln (xaxid, 10.,10.,0., 20.0,0.0)
	call tayxln (yaxid, 10.,10.,0., 20.0,0.0)

c	insert line type attribute in xaxid structure
	call tsln (xaxid, -1, PLDASH)

c	build circle 
	call tccr2 (circid, xc,yc, radius)

c	define scene
	call TSCENE (scenid,3,listid,viewid)
   
c	define a centered 2D view 
	call tv2cen (wkid,viewid,0.5,0.5,zoom,viewpt)

c	display scene on workstation 
	call ppost (wkid,scenid,1.0)
	call prst (wkid,PALWAY)

c	close workstation and PHIGURE 
	call tclwk (wkid)

c	generate PostScript file     
	open (30,file='PostScript_file',status='unknown')
	call topwk (wkip,30,80791)
	call tv2cen (wkip,viewid,0.5,0.5,zoom,viewpt)
	call ppost (wkip,scenid,1.0)
	call prst (wkip,PALWAY)
	call tclwk (wkip)

	call tclph 
	end

To generate a PostScript file corresponding to the preceding image, use a PostScript-type workstation (8079x) and apply the following rules :

define a second workstation identifier PostScript_id

open the Post-Script workstation TOPWK (PostScript_id, ...)

define a view on this workstation TV2CEN (for example)

post the structures to be displayed PPOST (PostScript_id, ...)

plot the posted structures PRST (PostScript_id, ...)

close the file TCLWK (PostScript_id, ...)

In general, if the PostScript file has to correspond exactly to the image obtained on the first workstation WKID it suffices to duplicate all the calls with WKID as the first parameter.


Previous Next Up Title Contents Index Functions Index Top Library