/* ***************************************************************************** /* /* GEOLOGICAL SURVEY OF CANADA /* --------------------------- /* /* Name: gsclogo.aml /* Usage: GSCLOGO {BW | COLOUR} /* {E | F} {crest_size} {point_size | NOTEXT} /* GSCLOGO BORDER {BW | COLOUR} /* {E | F} {crest_size} {point_size | NOTEXT} /* Arc version: 6.1.1 /* Module: Arcplot /* OS: Sun OS 4.1.2 /* Platform: Sun SPARCstation2 /* /* Purpose: Draw GSC logo by user either specifying which position of the /* logo to place at the specified x,y page coordinates or /* specifying a coordinate on the border in map units. /* The user can also state which language to appear first, the /* size of the crest and the the point size. By default, english /* appears first, the size of the crest is 0.7 inches and the /* point size of text on either side of the crest is 10x the size /* of the crest. /* /* Arguments: position - the position on the logo or the keyword BORDER /* x - x coordinate in page units or map units /* y - y coordinate in page units or map units /* colour - logo to be plotted in black & white or colour /* language - english or french to appear first in logo /* size - size of the crest /* ptsize - point size of the text on either side of the crest or /* if text is not plotted /* Globals: none /* Locals: mess - current setting of &messages /* default_size - default size crest /* units - current setting of UNITS /* weed - current setting of WEEDDRAW /* mapunits - current setting of MAPUNITS /* angle - current setting of MAPANGLE /* lineset - current LINESET /* linescale - current LINESCALE setting /* shadeset - current SHADESET /* shadescale - current SHADESCALE setting /* pagecoo_x - x page coordinate from converting x map coordinate /* pagecoo_y - y page coordinate from converting y map coordinate /* offset - vertical offset from border edge (6 mm) /* x_text - x page coordinate for text placement /* y_text - y page coordinate for text placement /* outer_circle - outer circle line thickness /* inner_circle - inner circle line thickness /* graticule - graticule line thickness /* shoreline - shoreline line thickness /* /* Called by: user /* Calls made: none /* /* History: Original coding by Vic Dohar, April 1993 /* Addition of %path% variable for users &atool to covers. /* Changed plotting of inner and outer circles as graphic features. /* /* ***************************************************************************** /* /* 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 language size ptsize &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 GSCLOGO exists &if ^ [exists %path%/gsclogo -cover] &then &do &ty \In order to execute this aml the cover GSCLOGO must exist in your &ty current atool subdirectory structure. Contact your system manager. &mess %mess% &return &end /* then do /* Check if all arguments entered &if [null %y%] &then &call USAGE /* Verify that x and y arguments are numeric &if [type %x%] gt 0 or [type %y%] gt 0 &then &call USAGE /* Set default size of crest and default point size of text &s default_size 0.7 &s default_ptsize 7 &s plottext .TRUE. /* Check if colour, language, crest size and point size options entered /* and are of correct type &if ^ [null %colour%] &then &do &if [type %colour%] ne 1 &then &call USAGE &select [translate %colour%] &when BW, # &s colour BW &when COLOUR, COL, C &s colour COLOUR &otherwise &call USAGE &end /* select /* Check if language entered &if ^ [null %language%] &then &do &if [type %language%] ne 1 &then &call USAGE &select [translate %language%] &when E, # &s language E &when F &s language F &otherwise &call USAGE &end /* select /* Check if size of crest entered &if ^ [null %size%] &then &do &if [type %size%] gt 0 &then &do &if %size% eq # &then &s size %default_size% &else &call USAGE &end /* then do &else &do /* Check that size is greater than 0 &if %size% le 0 &then &do &ty Crest size must be greater than zero. &call USAGE &end /* then do &end /* else do /* Check if point size of text entered &if ^ [null %ptsize%] &then &do &if [type %ptsize%] ge 0 &then &do &select [upcase %ptsize%] &when # &s ptsize [calc %size% * 10] &when NOTEXT &s plottext .FALSE. &otherwise &call USAGE &end /* select &end /* then do &else &do /* Check that point size is greater than zero &if %ptsize% 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 ptsize %size% * 10 &end /* then do &else &do &s size %default_size% &s ptsize %default_ptsize% &end /* else do &end /* then do &else &do &s language E &s size %default_size% &s ptsize %size% * 10 &end /* else do &end /* then do &else &do &s colour BW &s language E &s size %default_size% &s ptsize %size% * 10 &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 lineset [show lineset] &s linescale [show linescale] &s shadeset [show shadeset] &s shadescale [show shadescale] &s textset [show textset] &s textscale [show textscale] /* Position logo and setup plotting environment &select [trans %position%] &when BORDER; &do &s pagecoo_x [extract 1 [show convert map %x% %y% page]] &s offset 6 /* in mm &select [show pageunits] &when INCHES &s pagecoo_y [extract 2 [show convert map %x% %y% page]] ~ + ( %offset% / 25.4 ) &when CM &s pagecoo_y [extract 2 [show convert map %x% %y% page]] + 0.%offset% &otherwise; &do &ty \Note: Unable to plot GSCLOGO_[trans %language%] at corner of &ty border, because pageunits must be INCHES or CM &mess %mess% &return &end /* otherwise &end /* select WEEDDRAW OFF MAPEXTENT %path%/gsclogo MAPUNITS INCHES MAPSCALE [calc %default_size% / %size%] MAPANGLE 0 MAPPOSITION 0.35 0 %pagecoo_x% %pagecoo_y% &s x_text %pagecoo_x% &s y_text %pagecoo_y% + ( %size% / 2 ) &end /* when BORDER &when UC; &do &call SETUP MAPPOSITION 0.35 0.70 %x% %y% &s x_text %x% &s y_text %y% - ( %size% / 2 ) &end /* when UC &when CC; &do &call SETUP MAPPOSITION 0.35 0.35 %x% %y% &s x_text %x% &s y_text %y% &end /* when CC &when LC; &do &call SETUP MAPPOSITION 0.35 0.00 %x% %y% &s x_text %x% &s y_text %y% + ( %size% / 2 ) &end /* when LC &otherwise &call USAGE &end /* select &if %colour% eq BW &then &do /* Set line symbols for all black lines &s outer_circle 0.012 &s inner_circle 0.009 &s graticule 0.003 &s shoreline 0.006 &s greatlakes 0.006 LINEDELETE ALL LINETYPE WIDE LINESIZE %outer_circle% LINEPEN %outer_circle% BUTT MITER LINECOLOR CMYK -1 -1 -1 100 LINEPUT 1 LINESIZE %inner_circle% LINEPEN %inner_circle% BUTT MITER LINEPUT 2 LINESIZE %graticule% LINEPEN %graticule% BUTT MITER LINEPUT 3 LINESIZE %greatlakes% LINEPEN %greatlakes% BUTT MITER LINEPUT 4 LINESIZE %shoreline% LINEPEN %shoreline% BUTT MITER LINEPUT 7 LINESCALE [calc 1 / [show mapscale]] /* Plot outer and inner circles as Arcplot circles instead of arcs from /* the cover CLEARSELECT RESELECT %path%/gsclogo ARCS GSCLOGO-ID LE 2 &s units_setting [show units] UNITS MAP LINESYMBOL 1 CIRCLE 0.34949 0.35009 0.350015 LINESYMBOL 2 CIRCLE 0.34949 0.35009 0.250677 UNITS %units_setting% /* Plot remaining arcs NSELECT %path%/gsclogo ARCS UNSELECT %path%/gsclogo ARCS GSCLOGO-ID EQ 5 OR ~ GSCLOGO-ID EQ 6 ARCLINES %path%/gsclogo /* Shade text and hammer SHADEDELETE ALL SHADESCALE 1 SHADETYPE COLOR SHADECOLOR CMYK -1 -1 -1 100 SHADEPUT 1 RESELECT %path%/gsclogo POLYS GSCLOGO-ID EQ 1 OR ~ GSCLOGO-ID EQ 3 POLYGONSHADES %path%/gsclogo 1 &end /* then do &else &do /* when %colour% eq COLOUR /* Shade land blue SHADEDELETE ALL SHADESCALE 1 SHADETYPE COLOR SHADECOLOR CMYK 100 100 -1 -1 SHADEPUT 2 CLEARSELECT RESELECT %path%/gsclogo POLYS GSCLOGO-ID EQ 2 POLYGONSHADES %path%/gsclogo 2 /* Set line symbols for blue lines &s outer_circle 0.022 &s inner_circle 0.018 &s graticule 0.003 &s hammer 0.008 &s greatlakes 0.005 LINEDELETE ALL LINETYPE WIDE LINESIZE %outer_circle% LINEPEN %outer_circle% BUTT MITER LINECOLOR CMYK 100 100 -1 -1 LINEPUT 1 LINESIZE %inner_circle% LINEPEN %inner_circle% BUTT MITER LINEPUT 2 LINESIZE %graticule% LINEPEN %graticule% BUTT MITER LINEPUT 3 LINESIZE %greatlakes% LINEPEN %greatlakes% BUTT MITER LINEPUT 4 LINESIZE %hammer% LINEPEN %hammer% BUTT MITER LINEPUT 5 LINESCALE [calc 1 / [show mapscale]] /* Plot outer and inner circles as Arcplot circles instead of arcs from /* the cover CLEARSELECT RESELECT %path%/gsclogo ARCS GSCLOGO-ID LE 2 &s units_setting [show units] UNITS MAP LINESYMBOL 1 CIRCLE 0.34949 0.35009 0.350015 LINESYMBOL 2 CIRCLE 0.34949 0.35009 0.250677 UNITS %units_setting% /* Plot remaining arcs NSELECT %path%/gsclogo ARCS UNSELECT %path%/gsclogo ARCS GSCLOGO-ID GT 5 ARCLINES %path%/gsclogo /* Set yellow line symbols for outer and inner circles &s outer_circle 0.012 &s inner_circle 0.008 LINESYMBOL 1 LINESIZE %outer_circle% LINEPEN %outer_circle% ROUND MITER LINECOLOR CMYK -1 -1 100 -1 LINEPUT 1 LINESYMBOL 2 LINESIZE %inner_circle% LINEPEN %inner_circle% ROUND MITER LINECOLOR CMYK -1 -1 100 -1 LINEPUT 2 LINESCALE [calc 1 / [show mapscale]] /* Plot outer and inner circles as Arcplot circles instead of arcs from /* the cover CLEARSELECT RESELECT %path%/gsclogo ARCS GSCLOGO-ID LE 2 &s units_setting [show units] UNITS MAP LINESYMBOL 1 CIRCLE 0.34949 0.35009 0.350015 LINESYMBOL 2 CIRCLE 0.34949 0.35009 0.250677 UNITS %units_setting% /* Shade text and hammer polygons (hammer on top of outline) SHADEDELETE ALL SHADESCALE 1 SHADETYPE COLOR SHADECOLOR CMYK -1 -1 -1 100 SHADEPUT 1 SHADETYPE COLOR SHADECOLOR CMYK -1 -1 100 -1 SHADEPUT 3 CLEARSELECT RESELECT %path%/gsclogo POLYS GSCLOGO-ID EQ 1 POLYGONSHADES %path%/gsclogo 1 NSELECT %path%/gsclogo POLYS RESELECT %path%/gsclogo POLYS GSCLOGO-ID EQ 3 POLYGONSHADES %path%/gsclogo 3 &end /* else do /* Plot text on either side of logo &if %plottext% &then &do TEXTDELETE ALL TEXTSCALE 1 TEXTFONT 'Triumvirate' TEXTCOLOR CMYK -1 -1 -1 100 TEXTQUALITY PROPORTIONAL TEXTSTYLE SIMPLE TEXTOFFSET 0 0 TEXTSIZE %ptsize% [calc 0.9 * %ptsize%] PT MOVE [calc %x_text% - ( %size% * 0.6875 )] %y_text% &if %language% eq E &then TEXT 'GEOLOGICAL SURVEY OF CANADA' LR &else TEXT 'COMMISSION GÉOLOGIQUE DU CANADA' LR MOVE [calc %x_text% + ( %size% * 0.6875 )] %y_text% &if %language% eq E &then TEXT 'COMMISSION GÉOLOGIQUE DU CANADA' LL &else TEXT 'GEOLOGICAL SURVEY OF CANADA' LL &end /* then do /* Resetting Arcplot environment &call RESET &return /* ----------------------------------------------------------------------------- &routine SETUP UNITS PAGE WEEDDRAW OFF MAPEXTENT %path%/gsclogo MAPUNITS INCHES MAPSCALE [calc %default_size% / %size%] MAPANGLE 0 &return &routine USAGE &ty Usage: GSCLOGO {BW | COLOUR} &ty {E | F} {crest_size} {point_size | NOTEXT} &ty GSCLOGO BORDER {BW | COLOUR} &ty {E | F} {crest_size} {point_size | NOTEXT} &mess %mess% &return; &return &routine RESET MAPUNITS %mapunits% MAPANGLE %angle% LINEDELETE ALL LINESET %lineset% LINESCALE %linescale% SHADEDELETE ALL SHADESET %shadeset% SHADESCALE %shadescale% TEXTDELETE ALL TEXTSET %textset% TEXTSCALE %textscale% UNITS %units% WEEDDRAW %weed% &mess %mess% &return &routine ERROR &severity &error &ignore &call RESET &ty *** An error has occured plotting the GSC Logo *** &return; &return