/*
 *
 *                    plotcoords.c
 *
 *
 *	Define default maximum and minimum plotting coordinates.
 *		P1 (xmin, ymin),  P2 (xmax, ymax)
 *
 *	PaperSize can be:
 *			"A3" ISO (420mm by 297mm)
 *			"A4" ISO (297mm by 210mm)
 *			"A"  ANSI (11" by 8.5")
 *			"B"  ANSI (17" by 11")
 *
 *	Mode can be:	"HPGL" only (Note: DXY was supported but most Roland
 *			plotters can support HPGL.)
 *
 * Don McCormick
 */

#include "defn.h"

plotcoords()
              /*  this function establishes default coordinate values for
               *  scaling points. USER_UNITS == FALSE in this stage.
	       */
{
    if (strcmp(Mode, "HPGL") == 0)
    {
	    P2x = U2x = defP2x;
	    P2y = U2y = defP2y;
	    P1x = U1x = defP1x;
	    P1y = U1y = defP1y;

	if (strcmp(PaperSize, "A3") == 0)	/* HP-GL ISO A3 420mm * 297mm */
	{
	    maxprX = 16158;
	    maxprY = 11040;
	}
	else					/* HP-GL ISO A4 297mm * 210mm */
	{
	    maxprX = 11040;
	    maxprY = 7721;
	}

	minprX = minprY = 0;
    }
    else
    {
	fprintf(stderr,"ERROR - (plotcoords.c) mode not HPGL");
	exit(1);
    }
}


plotcoords2()
              /*  this function establishes default coordinate values for
               *  scaling points. USER_UNITS may be TRUE or FALSE in this stage.
	       */
{
    if (strcmp(Mode, "HPGL") == 0)
    {
       if (ROTATE_STATE == 0)
       {
	    P2x = defP2x;
	    P2y = defP2y;
	    P1x = defP1x;
	    P1y = defP1y;
       }
       else
       {
	    P2x = rotP2x;
	    P2y = rotP2y;
	    P1x = rotP1x;
	    P1y = rotP1y;
       }

    }
    else
    {
	fprintf(stderr,"ERROR - (plotcoords.c) mode not HPGL");
	exit(1);
    }
}

