/* *****************************************************************************
/*
/* GEOLOGICAL SURVEY OF CANADA
/* ---------------------------
/*
/* Name: cndlogo.aml
/* Usage: CNDLOGO
/* {K | R} {point_size}
/* Arc version: 6.1.1
/* Module: Arcplot
/* OS: Sun OS 4.1.2
/* Platform: Sun SPARCstation2, 1+
/*
/* Purpose: Draw Canada wordmark logo by user specifying which position of
/* the logo to place at the specified x,y page coordinates,
/* whether the flag is red or black and the point size of the logo.
/* By default the point size is 36, and the color is black.
/*
/* Arguments: position - the position on the logo
/* x - x coordinate in page units
/* y - y coordinate in page units
/* colour - the colour of the flag, black or red
/* size - point size of the Canada wordmark logo
/* Globals: none
/* Locals: echo - current setting of &echo
/* mess - current setting of &messages
/* def_size - default size of text in cover
/* units - current setting of UNITS
/* weed - current setting of WEEDDRAW
/* mapunits - current setting of MAPUNITS
/* angle - current setting of MAPANGLE
/* shadeset - current SHADESET in use
/* shadescale - currect SHADESCALE setting
/*
/* Called by: user
/* Calls made: none
/*
/* History: Original coding by Vic Dohar, March 1993
/* Specifying size in points, Vic Dohar, April 1993
/* Addition of %path% variable for users &atool to covers.
/*
/* *****************************************************************************
/*
/* CROWN COPYRIGHTS RESERVED
/*
/* NO GUARANTEE IS MADE BY THE AUTHOR(S) OR THE GEOLOGICAL SURVEY OF
/* CANADA REGARDING EITHER THE ACCURACY OF THIS PROGRAM OR THE PROPER
/* EXECUTION ON ALL COMPUTER SYSTEMS.
/*
/* *****************************************************************************
&args position x y colour size
&severity &warning &ignore
&severity &error &routine ERROR
/* Setting command display variables
&s mess [show &messages]
&if [show &echo] eq &ON &then
&mess &on
&else
&mess &off &all
/* Check if user is running Arcplot
&if [show program] ne ARCPLOT &then &do
&ty This AML can only run from Arcplot
&mess %mess%
&return
&end /* then do
/* Set path to covers using atool path, same as for this aml
&s path [before [extract 1 [show &atool]] /amls]/covers
/* Check if cover CNDLOGO exists
&if ^ [exists %path%/cndlogo -cover] &then &do
&ty \In order to execute this aml the cover CNDLOGO must exist in your
&ty current atool subdirectory structure. Contact your system manager.
&mess %mess%
&return
&end /* then do
/* Check if all necessary arguments entered
&if [null %y%] &then
&call USAGE
/* Verify that page x and y arguments are numeric
&if [type %x%] gt 0 or [type %y%] gt 0 &then
&call USAGE
/* Set default point size of text in cover
&s def_size 36
/* Verify that colour argument is R or K, and point size if enetered is numeric
&if ^ [null %colour%] &then &do
&if [type %colour%] ne 1 &then
&call USAGE
&else &do
&select [translate %colour%]
&when #, K
&s colour K
&when R
&s colour R
&otherwise
&call USAGE
&end /* select
&if ^ [null %size%] &then &do
&if [type %size%] ge 0 &then
&call USAGE
&else &do
/* Check that point size is greater than zero
&if %size% le 0 &then &do
&ty Point size must be greater than zero.
&call USAGE
&end /* then do
&end /* else do
&end /* then do
&else
&s size %def_size%
&end /* else do
&end /* then do
&else &do
&s colour K
&s size %def_size%
&end /* else do
/* Saving current arcplot environment settings
&s units [show units]
&s weed [show weeddraw]
&s mapunits [show mapunits]
&s angle [show mapangle]
&s shadeset [show shadeset]
&s shadescale [show shadescale]
/* Position logo and setup plotting environment
&select [trans %position%]
&when UL; &do
&call SETUP
MAPPOSITION 0 0.5 %x% %y%
&end /* when UL
&when CL; &do
&call SETUP
MAPPOSITION 0 0.25 %x% %y%
&end /* when CL
&when LL; &do
&call SETUP
MAPPOSITION 0 0 %x% %y%
&end /* when LL
&when UC; &do
&call SETUP
MAPPOSITION 1.05 0.5 %x% %y%
&end /* when UC
&when CC; &do
&call SETUP
MAPPOSITION 1.05 0.25 %x% %y%
&end /* when CC
&when LC; &do
&call SETUP
MAPPOSITION 1.05 0 %x% %y%
&end /* when LC
&when UR; &do
&call SETUP
MAPPOSITION 2.1 0.5 %x% %y%
&end /* when UR
&when CR; &do
&call SETUP
MAPPOSITION 2.1 0.25 %x% %y%
&end /* when CR
&when LR; &do
&call SETUP
MAPPOSITION 2.1 0 %x% %y%
&end /* when LR
&otherwise
&call USAGE
&end /* select
/* Begin plotting logo
CLEARSELECT
SHADEDELETE ALL
SHADESCALE 1
SHADETYPE COLOR
SHADECOLOR CMYK -1 -1 -1 100
SHADEPUT 1
&if %colour% eq K &then &do /* when flag is black
RESELECT %path%/cndlogo POLYS CNDLOGO-ID NE 0
POLYGONSHADES %path%/cndlogo 1
&end /* then do
&else &do /* when flag is red
RESELECT %path%/cndlogo POLYS CNDLOGO-ID EQ 1
POLYGONSHADES %path%/cndlogo 1
CLEARSELECT
RESELECT %path%/cndlogo POLYS CNDLOGO-ID EQ 2
SHADECOLOR CMYK -1 100 100 -1
SHADEPUT 1
POLYGONSHADES %path%/cndlogo 1
&end /* else do
/* Resetting Arcplot environment
&call RESET
&return
/* -----------------------------------------------------------------------------
&routine SETUP
UNITS PAGE
WEEDDRAW OFF
MAPEXTENT %path%/cndlogo
MAPUNITS INCHES
MAPSCALE [calc %def_size% / %size%]
MAPANGLE 0
&return
&routine USAGE
&ty Usage: CNDLOGO
&ty {K | R} {point_size}
&mess %mess%
&return; &return
&routine RESET
WEEDDRAW %weed%
MAPUNITS %mapunits%
MAPANGLE %angle%
SHADEDELETE ALL
SHADESET %shadeset%
SHADESCALE %shadescale%
UNITS %units%
&mess %mess%
&return
&routine ERROR
&severity &error &ignore
&call RESET
&ty *** An error has occured plotting the Canada Wordmark ***
&return; &return