]> www.wagner.pp.ru Git - oss/fgis.git/blob - doc/layers.doc
First checked in version
[oss/fgis.git] / doc / layers.doc
1 Guidelines to impliment layers
2
3 New types of layer can be defined in fgis using
4
5 layer typedef command
6
7 They should implement following commands
8
9 1. info option
10   Obligatory
11   Returns boolean value indicating that certain operation
12   are supported by this layer.
13   Required options are
14
15    opaque - layer could be displayed as base layer in planchet
16    lookable - layer could be inserted in planchet look list
17    legend - legend of this layer can be drawn by drawlegend command
18    limits - layer have working limits command
19    numeric - values of layer are subject of arithmetic operations
20    dimension - returns 0 if layer defined on the set of point,
21              1 on set of lines (i.e. vector file)
22              2 on continuous area (i.e. raster)
23    reclass - if it is raster layer, returns true if counting operation
24              should use reclass table otherwise can return anything
25 2. dump
26   Obligatory
27   Returns TCL script which can be used to reimplement this layer
28   using layer load command.
29   This script would be executed at global level with value of
30   variable fgisLayerName set to desired name of this layer.
31   All objects which could be neccessary for existance of layer
32   (i.e. legends, palettes, pattern sets) should be recreated
33   by this script. (it is assumed that all neccessary files exist
34   in same locations)
35
36 3. value x y ?flag?
37    If lookable is true
38   Returns value of layer at given point 
39 k
40   Flag can be one of following
41   -raw - return value
42   -list - return two-element list consisting of layer title and value
43   -titled -return string as you like to appear in look window
44            presumable results of
45            [join [$layer value $x $y -list] ": "]
46   If layer is not defined in given point, this command should return
47   empty string.
48
49 4.show planchet mode
50   obligatory
51   should record information that layer is visible in specified planchet
52   and optionally create certain items in this planchet which are persistent.
53   These items should have same tag as layer name (may be among other tags)
54   mode is either -base or -overlay
55 5.hide planchet 
56   obligatory
57   removes information that layer is visible in planchet. It is up to
58   planchet to remove all related items
59 6.redraw planchet
60   obligatory
61   Do all neccessary things to redraw itself in planchet, including
62   deletion of items which are no more applicable.
63   
64 7.configure option arg ?option arg?
65   obligatory
66   changes properties of layer and issues redraw command for all planchets,
67   where layer is currently visible, if this changes can affect view
68
69 8. legclasses
70   if [$layer info legend] is true
71    returns list of classes, which should be drawn by drawlegend
72 9 sample canvas index x y ?mode? 
73   if [$layer info legend] is true
74   given index from list returned from legclasses, canvas and coordinates
75   should draw sample of itself. All items constituting this sample should
76   have tag $layername$index
77   mode is either -base or -overlay
78 10 legtext index 
79   if [$layer info legend] is true
80   returns text to draw near the sample
81 11 title 
82 12 subtitle
83    Returns string to draw as title or subtitle of legend
84 13 expand list
85    given list of two-element lists
86    rasterclass area  
87    return list of two-element lists
88    value area.
89 14 delete
90    Obligatory - destroys itself 
91