README 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. Symbol drawing commands are stored in a text file (one file for each symbol)
  2. which are located in $GISBASE/etc/symbol/group/name or mapset/symbol/group/name
  3. S_read() searches first in mapsets and then in $GISBASE (symbol names in
  4. $GISBASE may be overridden by symbols of the same group/name in mapset).
  5. File format example:
  6. VERSION 1.0
  7. BOX -10 -10 10 10
  8. STRING
  9. LINE
  10. 0 -10
  11. 0 10
  12. END
  13. END
  14. A symbol file is composed of objects, each object starts with a keyword and
  15. ends with a new line or 'END'. Some objects may contain other objects.
  16. - Drawing is composed of POLYGONS and STRINGS.
  17. - POLYGONS are composed of RINGS. The first ring is outer (clockwise for now),
  18. following rings are inner (counter clockwise currently).
  19. - STRINGS and RINGS are composed of LINES and ARCS.
  20. POLYGONS and STRINGS are drawn using the default color and fill color
  21. (specified in module options such as 'd.vect color='). This color may be
  22. overwritten by using the COLOR and FCOLOR keywords.
  23. Blank lines and lines starting with a #hash will be ignored.
  24. ---- DESCRIPTION OF OBJECTS ----
  25. In the following descriptions these variables are used:
  26. N - integer number
  27. R G B - RGB color as 3 numbers ranging 0-255
  28. X,Y - coordinates (double precision floating point)
  29. Keywords:
  30. VERSION N.N
  31. Version number
  32. BOX X Y X Y
  33. Bounding box. Lower left and upper right corner. Larger side of box is taken
  34. as 1 for symbol scaling. That means that if size of box is 10 x 5, and scale
  35. in application is 2, all geometry will be multiplied by: 2 / 10.
  36. Origin of symbol is 0,0.
  37. COLOR NONE | R G B
  38. Color used for string or outline of polygon. If NONE is used, then the polygon
  39. outline is not drawn.
  40. FCOLOR NONE | R G B
  41. Fill color used for polygon. If NONE is used, then the polygon is not filled.
  42. LINE
  43. X Y
  44. X Y
  45. [X Y]
  46. END
  47. Line constructed from coordinate pairs.
  48. ARC X Y R A1 A2 [C]
  49. Arc specified by center (X Y), radius (R), start/end angle in degrees (A1/A2)
  50. and optionally direction (C for clockwise, default counter clockwise)
  51. Note degrees are polar theta not navigational, i.e. 0 is east and
  52. values increase counter-clockwise from there. Reducing the angle
  53. from a full circle does not make it draw like a pacman but rather
  54. with a straight chord-line from the start/end points on the circle
  55. as defined by the two angles.
  56. STRING
  57. [COLOR R G B]
  58. LINE | ARC
  59. [LINE | ARC]
  60. END
  61. String composed of any number of lines and/or arcs.
  62. RING
  63. LINE | ARC
  64. [LINE | ARC]
  65. END
  66. Ring composed of any number of lines and/or arcs. A ring is automatically
  67. closed with a line from last point to first point.
  68. POLYGON
  69. [COLOR R G B]
  70. [FCOLOR R G B]
  71. RING
  72. [RING]
  73. END
  74. A polygon is composed of any number of rings. The first ring is outer
  75. (clockwise) and others are inner (counter-clockwise).
  76. ------------------------------------
  77. Note: restriction for clockwise/counter clockwise rings should be removed
  78. later and replaced by reordering in symbol library. Order is required by
  79. ps.map because PS uses even-odd rule for polygon filling.
  80. Internal structure:
  81. A symbol read into memory is stored in structure SYMBOL containing an array
  82. of parts (SYMBPART). Each part may be of type S_STRING or S_POLYGON, and
  83. contain an array of chains (SYMBCHAIN) where both STRING or POLYGONS are
  84. stored. One chain contains an array of elements (SYMBEL).