Programming and Graphics

(Kiana) #1

230 Introduction to C++ Programming and Graphics


...

//--- Prepare the graph:

...

//--- Draw axes:

...

//-----------------------------
if(Itry==1)
{
vexit();
goto again;
};
//-----------------------------

cout << "Press p to print a postscript file" << endl;
cout << " any other key to finish" << endl;
kbd = char(getkey());

if(kbd ==ā€™pā€™)
{
char outfile[1];
cout << " Please enter the name of the postscript file " <<endl;
cin >> outfile;
cout << "Please enter:" << endl << endl;
cout <<" 1 for a black/white plot" << endl;
cout <<" 2 for a black/white plot in portrait" << endl;
cout <<" 3 for a color plot" << endl;
cout <<" 4 for a color plot with background color" << endl;
cout <<" 5 for a color plot in portrait" << endl;
cout <<" 6 for a color plot in portrait with background color" << endl;
short Iplot;
cin >> Iplot;

voutput (outfile);

if(Iplot==1) vnewdev("postscript");
if(Iplot==2) vnewdev("ppostscript");
if(Iplot==3) vnewdev("cps");
if(Iplot==4) vnewdev("cps");
if(Iplot==5) vnewdev("pcps");
if(Iplot==6) vnewdev("pcps");

Itry = 1;
goto repeat;
}
Free download pdf