portrait

Поиск



[software] [catdoc] [tcl] [geography] [old things]
Table of Contents



NAME

planchet - Create and manipulate planchet widgets

SYNOPSIS

planchet pathName ?options ?

STANDARD OPTIONS

-background    -insertwidth    -state
-insertbackground    -relief    -tile
-cursor    -insertborderwidth    -selectbackground    -takefocus
-highlightbackground    -insertofftime    -selectborderwidth    -xscrollcommand
-highlightcolor    -insertontime    -selectforeground    -yscrollcommand

See the options manual entry for details on the standard options.

Note: Standard optiosn -highlightthickness and -bordewidth are ignored by planchet, and set to 0. Therefore -relief options have no effect.

WIDGET-SPECIFIC OPTIONS

Command-Line Name:    -coordformat
Database Name:    coordFormat
Database Class:    CoordFormat

Specifies format string to display current map coordinates, if no projection
defined. Defaults to "X=%0.8g Y=%0.8g"

Command-Line Name:    -orient
Database Name:    orient
Database Class:    Orient

Specifies printing orientation for this planchet. May be either portrait
or landscape. Defaults to landscape

Command-Line Name:    -lookwidth
Database Name:    lookWidth
Database Class:    LookWidth

Wraplength of text in popup look window. Defaults to 200.

Command-Line Name:    -shiftfactor
Database Name:    shiftFactor
Database Class:    ShiftFactor

Specifies share of window size to move on shift widget command.
Defaults to 0.75

Command-Line Name:    -resizable
Database Name:    resizable
Database Class:    Resizable

Specifies a boolean value that indicates whether or not should planchet
adjust its width/height ratio, when coordinate limits are first defined.

Command-Line Name:    -rulerpos
Database Name:    rulerPos
Database Class:    RulerPos

Indicates position of scale ruler in planchet. (its left end). Should be
list of two coordinates in any form, acceptable by Tk. Positive values are measured from top and left and negative from lower and right side of planchet

Command-Line Name:    -scalevar
Database Name:    scaleVar
Database Class:    Variable

Specifies the name of variable. Current scale of map would be stored in
this variable automatically upon each change of scale in form 1:denominator. If variable doesn't exist in global scope, it would be created.

Command-Line Name:    -statusline
Database Name:    statusLine
Database Class:    none

Specifies name of label widget which would be used for displaying status
information of planchet (i.e. current mouse pointer coordinates). Widget should exist before creating planchet or before passing it to planchet configure command.

Command-Line Name:    -legbox
Database Name:    legBox
Database Class:    none

Specifies name of canvas widget which would display scrollable legend of
base layer. Note, that scrollable legend is not printed automatically by print command. All contents of this widget would be erased each time base layer changed in planchet.

Command-Line Name:    -zoombutton
Database Name:    zoomButton
Database Class:    none

Specifies name of button, which is used to initiate zoom operation on
canvas. (usially via zoom ) widget command. Planchet controls its state, disabling it, if coordinate system is not defined. It should exist before it passed to planchet.

Command-Line Name:    -unzoombuttons
Database Name:    unzoomButtons
Database Class:    none

Specifies list of buttons, which are used to perform various unzoom operations
(like unzoom or limits default widget commands). Planchet controls their state, disabling them if such operations are impossible.

Command-Line Name:    -shiftbuttons
Database Name:    shiftButtons
Database Class:    none

Specifies list of four buttons for perform shift operation on planchet.
Buttons are specified in following order left(west) down(south) up(north) and right(west), the same way as vi cursor movement keys are situated on keyboard.

Command-Line Name:    -zoombutton
Database Name:    zoomButton
Database Class:    none

Specifies name of button, which is used to initiate zoom operation on
canvas. (usially via zoom ) widget command. Planchet controls its state, disabling it, if coordinate system is not defined. It should exist before it passed to planchet.

Command-Line Name:    -unzoombuttons
Database Name:    unzoomButtons
Database Class:    none

Specifies list of buttons, which are used to perform various unzoom operations
(like unzoom or limits default widget commands). Planchet controls their state, disabling them if such operations are impossible.

Command-Line Name:    -shiftbuttons
Database Name:    shiftButtons
Database Class:    none

Specifies list of four buttons for perform shift operation on planchet.
Buttons are specified in following order left(west) down(south) up(north) and right(west), the same way as vi cursor movement keys are situated on keyboard. This buttons should be either all be specified or all be empty, in which case list of four empty elements should be passed. Planchet not only controls state of buttons, but also redefines their commands.

Command-Line Name:    -projection
Database Name:    projection
Database Class:    none

Specifies Fgis projection object which is used to convert chartographic
coordinates of planchet into geographic (latitude and longitude) and vice versa.

In addition to these all options of canvas widget are supported.

INTRODUCTION

The planchet command creates a new window (given by the pathName argument and makes it into planchet widget.

Additional options, described above, can be given to control its behavoir. Currently they could be specified only in command line, not in option database, but it shoudl change in future.

planchet command returns its pathName argument. At the time this command is invoked, there must not exist a window, named pathName , but pathName 's parent must exist. planchet command also creates new Tcl command named pathName which can be used to control widget.

Planchet widget have all behavoir supported by Tk canvas widget, but, in addition it could have chartographic coordinate system and able to visualize and manipulate maps.

COORDINATE SYSTEM

Planchet coordinate system is real-world coordinate system. Its coordinates should be in meters of earth surface, not in pixels, millimeters or other map sheet or screen-related units. It can be defined either explicitely via limits widget command, or implicitely, when first map is shown in planchet.

There are special commands which allow to recalculate from map (realword) coordinates to screen coordinates. Screen coordinate system of planchet is same as of canvas.

LAYERS

Planchet can visualize maps, which are represented as Fgis layer objects. There are two ways of display layer - as base layer or as ovelay.

Base layers are opaque, they are typically raster layers, shown by colors. There can be only one base layer in plachet in given time. If legbox helper widget is defined, and legend for base layer is drawable, it would be displayed in this widget. Several layer types couldn't be displayed as base layers.

Overlay layers are transparent, although visible. There can be several overlay layers in planchet at given time. Any layer can be displayed as overlay.

When first layer is displayed in planchet, with undefined coordinate system, coordinate system limits for planchet are got from limits of layer. If layer cannot provide this information, it causes an error.

HELPER WIDGETS

Planchet can be accompanied with several other widgets, which are used to interact with user. If this widgets are passed to planchet via commandline options (or via widget configure ) command, it can control them automatically and disable them, if corresponding action is impossible. See OPTIONS ABOVE .

SCALE INDICATION

There are two traditional ways of scale indication - numerical and graphical. As numerical indication, -scalevar option of planchet widget allows to specfy Tcl global variable, which would always hold current value of map scale.

As graphical representation of scale, planchet can display scale ruler which shows how some realword distance is visible in planchet.

LOOK FEATURE

Planchet allows to collect information from several layers in given point. By default it pops up window with this information on right button click. Set of layers which included in this information is called look list .

WIDGET COMMAND

The planchet command creates a new Tcl command whose name is pathName . This command can be used to invoke various operaitons on the widget. It has following general form:

pathName option ?arg arg .. ?

Option and the arg s determine the exact behavior of the command. Planchet supports all widget commands, defined for canvas widget and following special commands, specific to planchet:
pathName clear
Removes all layers from planchet, and from look list and unsets coordinate system
pathName cget option
Returns value of specified configuration option. In addition to standard options and widget specific options, supports all options of canvas widget. Several internal variables can also be obtained this way, but it is dirty and undocumented hack.
pathName configure option arg ?option arg ...?
Allows to change value of one or more options.
pathName fit x y
Returns 1 if point, given in real world coordinates is inside current planchet limits, and 0 otherwise.
pathName hide pattern ?pattern...?
Removes all layers which matches pattern from planchet.
pathName layers ?pattern ?
Return list of all visible layers, either base or overlays, which match given pattern. By default - all layers.
pathName limits
Used to control limits of realword coordinate system. Can have one of following form
limits
Without any arguments return list of four double values, representing real world coordinates of window sides. They are given in folowing order:

XLeft YBottom XRight YTop

limits list
limits xleft ybottom xright ytop
Given list of four double values or four double values as separate arguments, sets planchet limits for this value. If -resizable option is true and no coordinate system was defined before, adjusts width/height ratio of planchet to reflect this ratio of given limits. Otherwise expands given limits to have same width/height ratio as widget.

If directions of axes of given limits doesn't match those of currently defined coordinate system, silently reverts them. Therefore order of coordinates in insignificant, once coordinate system is defined.

If coordinate system was defined, assumes that zooming operation is performed and stores old limits in zoom stack for subsequent unzoom operation. If scale of given limits is smaller, then of some limits in zoom stack, discards all elements with scale larger than given for unzoom operation shouldn't increase scale. Nevertheless initial limits are never discarded this way.

limits default
Clears zoom stack and restores coordinate limits to their initial values.
pathName look
Controls LOOK FEATURE of planchet. Can have one of following forms
look add layer
adds layer to look list.
look list ?pattern ?
Returns list of layers in look list, which match pattern. By default all layers
look remove pattern
removes layers which match pattern from look list
look remove all
clears look list entirely
look x y ?-titled|-list|-raw ?
return list of information for all layers in look list at given point. If -titled option is specified, each element in list is formatted string. Otherwise it is two element list which first element - layer title, and second - layer value. -raw option returns only values, without layer title information.

Length of this list not neccesary matches length of look list, becouse if some layers are undefined in given point, they do not create list element.

pathName mapx x
pathName mapy
Given screen coordinate in any form, acceptable by Tk, returns realword coordinate.
pathName print ?option arg ...?
Wrapper around postscript command. Uses default Fgis font mapping and print system, also widget default orientation. By default, send output to default Fgis printer using command, defined in fgis configuration file.

Following options are supported:

-colormode mode Same as colormode option in canvas postscript command.
-file filename
Write postscript representation of planchet into given file, instead of piping it to print command.
-fontmap variable
array used to map screen fonts to postscript fonts. See canvas postscript command for more information.
-printer printername
Overrides default printer, specified in fgis.rc file.
pathName ruler ?on|off?
Controls scale ruler.
pathName scale ?denominator ?
With no arguments returns current scale denominator. If denominator is given, adjust coordinate limits so that scale would be as specified and center point of widget would have same realworld coordinates as before.

If any other arguments are specified, behaves as canvas widget scale command.

pathName scrx x
pathName scry y
Given realworld coordinate, returns screen coordinate in pixels.
pathName setstatus
Displays message if -statusline helper widget, if defined, otherwise does nothing. Can have one of two form:
setstatus message
displays message as specified
setstatus x y
Displays given coordinates. If no projection defined, they would be displayed using Tcl format command with value of -coordformat option as first argument. Otherwise they would be displayed using format object command of current projection.
pathName shift direction
Changes current coordinate limits so that current view shifts in specified direction by share of corresponding widget size, specified by -shiftfactor option.
pathName show layer ?-base |-overlay ?
Displays specified layer. If neither -base nor -overlay is specifed, shows layer as base if no base layer currently present and layer can be displayed as base. Otherwise displays it as overlay.
pathName unzoom
Pops last coordinate limits from zoom stack
pathName zoom ? x y ? x y ??
Initiates interactive zoom operation. If no coordinates are specified, prompts user to pick both corners of rectangle to display. If one pair is specified, prompts only for second pair. With two pairs just converts values from canvas to realworld coordinates and performs limits command on them.

pathName zoom cancel

can be used to abort interactive zoom operation currently in progress.

pathName zoom cancel

can be used to abort interactive zoom operation currently in progress.

SEE ALSO

layer(n)

BUGS

No care taken to do something useful if interactive zoom operation is performed on two planchets simulateously.


Table of Contents