home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 06 / titel / plot.bas < prev    next >
BASIC Source File  |  1990-03-05  |  6KB  |  255 lines

  1. '* ------------------------------------------------------- *
  2. '*                       PLOT.BAS                          *
  3. '* Bibliothek für High-Level und Low-Level Plotterroutinen *
  4. '*         (c) 1990 Wolfhard Rinke & TOOLBOX               *
  5. '* ------------------------------------------------------- *
  6. DECLARE SUB PCircle (xm%, ym%, r%)
  7. DECLARE SUB PPSet (x%, y%, col%)
  8. DECLARE SUB PClose ()
  9. DECLARE SUB PFillBox (x1%, y1%, x2%, y2%)
  10. DECLARE SUB PSymbolMode (c$)
  11. DECLARE SUB PAbsoluteDirection (r%, rise%)
  12. DECLARE SUB PArcAbsolute (x%, y%, center%)
  13. DECLARE SUB PArcRelative (x%, y%, center%)
  14. DECLARE SUB PCharPlot (hor%, ver%)
  15. DECLARE SUB PCharSet (n%)
  16. DECLARE SUB PFilltype (typ%, space%)
  17. DECLARE SUB PLineType (typ%, length%)
  18. DECLARE SUB PPlotrelative (x%, y%)
  19. DECLARE SUB PPrint (s$)
  20. DECLARE SUB PRectangleAbsolute (x%, y%)
  21. DECLARE SUB PRectangleRelative (x%, y%)
  22. DECLARE SUB PScale (xmin%, ymin%, xmax%, ymax%)
  23. DECLARE SUB PScalingPoint (x1%, y1%, x2%, y2%)
  24. DECLARE SUB PSegment (r%, start%, center%)
  25. DECLARE SUB PShadeRectAbsolute (x%, y%)
  26. DECLARE SUB PShadeRectRelative (x%, y%)
  27. DECLARE SUB PTextSize (wid!, size!, slant!)
  28. DECLARE SUB PWindow (x1%, y1%, x2%, y2%)
  29. DECLARE SUB PShadeSector (r%, start%, center%)
  30. DECLARE SUB PInit ()
  31. DECLARE SUB PPenDown ()
  32. DECLARE SUB PPenUp ()
  33. DECLARE SUB PGetPen (col%)
  34. DECLARE SUB PMove (x%, y%)
  35. DECLARE SUB PLine (x1%, y1%, x2%, y2%)
  36. DECLARE SUB PColor (col%)
  37. DECLARE SUB PBox (x1%, y1%, x2%, y2%)
  38.  
  39. '$INCLUDE: 'REGISTER.INC' : REM Für spätere Fehlerbehandlung
  40.  
  41. CONST MaxX% = 7400, MaxY% = 10300       : '* Sekonic SPL 450
  42.  
  43. CONST Black% = 1, Red% = 2, Orange% = 3, Brown% = 4
  44. CONST Blue% = 5, Magenta% = 6, Green% = 7, Yellow% = 8
  45.  
  46. '* ------ ganz kurze Demo -------------------------------- *
  47. PInit
  48. PColor Black%
  49. PFilltype 5, 100
  50. PFillBox 2200, 2200, 3200, 3200
  51. PBox 0, 0, MaxX%, MaxY%
  52. PPSet MaxX% \ 2, MaxY% \ 2, Red%
  53. PCircle MaxX% \ 2, MaxY% \ 2, 300
  54. PPlotrelative 0, 400
  55. PPrint "Toolbox - was sonst?"
  56. PMove 2000, 8000
  57. PSegment 1000, 90, 325
  58. PMove 4000, 8000
  59. PFilltype 1, 50
  60. PShadeSector 1000, 70, 290
  61. PClose
  62. END
  63.  
  64. '* ------------------------------------------------------- *
  65. SUB PAbsoluteDirection (r%, rise%)
  66.   r$ = STR$(r%)
  67.   rise$ = STR$(rise%)
  68.   LPRINT "DI" + r$ + "," + rise$ + ";"
  69. END SUB
  70.  
  71. SUB PArcAbsolute (x%, y%, center%)
  72.   x$ = STR$(x%)
  73.   y$ = STR$(y%)
  74.   center$ = STR$(center%)
  75.   LPRINT "AA" + x$ + "," + y$ + "," + center$ + ";"
  76. END SUB
  77.  
  78. SUB PArcRelative (x%, y%, center%)
  79.   x$ = STR$(x%)
  80.   y$ = STR$(y%)
  81.   center$ = STR$(center%)
  82.   LPRINT "AR" + x$ + "," + y$ + "," + center$ + ";"
  83. END SUB
  84.  
  85. SUB PBox (x1%, y1%, x2%, y2%)
  86.   PLine x1%, y1%, x2%, y1%
  87.   PLine x2%, y1%, x2%, y2%
  88.   PLine x2%, y2%, x1%, y2%
  89.   PLine x1%, y2%, x1%, y1%
  90. END SUB
  91.  
  92. SUB PCharPlot (hor%, ver%)
  93.   hor$ = STR$(hor%)
  94.   ver$ = STR$(ver%)
  95.   LPRINT "CP" + hor$ + "," + ver$ + ";"
  96. END SUB
  97.  
  98. SUB PCharSet (n%)
  99.   LPRINT "CA" + STR$(n%) + ";"
  100. END SUB
  101.  
  102. SUB PCircle (xm%, ym%, r%)
  103.   r$ = STR$(r%)
  104.   PPenUp
  105.   PMove xm%, ym%
  106.   LPRINT "CI" + r$
  107.   PPenUp
  108. END SUB
  109.  
  110. SUB PClose
  111.   PGetPen 0
  112.   PPenUp
  113.   PMove 0, 0
  114. END SUB
  115.  
  116. SUB PColor (col%)
  117.   PGetPen col%
  118. END SUB
  119.  
  120. SUB PFillBox (x1%, y1%, x2%, y2%)
  121.   PPenUp
  122.   PMove x1%, y1%
  123.   PShadeRectAbsolute x2%, y2%
  124.   PPenUp
  125. END SUB
  126.  
  127. SUB PFilltype (typ%, space%)
  128.   typ$ = STR$(typ%)
  129.   spc$ = STR$(space%)
  130.   LPRINT "FT" + typ$ + "," + spc$ + ";"
  131. END SUB
  132.  
  133. SUB PGetPen (col%)
  134.   LPRINT "SP" + STR$(col%) + ";"
  135. END SUB
  136.  
  137. SUB PInit
  138.   LPRINT "IN;DF;PA0,0;"
  139. END SUB
  140.  
  141. SUB PLine (x1%, y1%, x2%, y2%)
  142.   PMove x1%, y1%
  143.   PPenDown
  144.   PMove x2%, y2%
  145.   PPenUp
  146. END SUB
  147.  
  148. SUB PLineType (typ%, length%)
  149.   typ$ = STR$(typ%): length$ = STR$(length%)
  150.   LPRINT "LT" + typ$ + "," + length$ + ";"
  151. END SUB
  152.  
  153. SUB PMove (x%, y%)
  154.   x$ = STR$(x%)
  155.   y$ = STR$(y%)
  156.   LPRINT "PA" + x$ + "," + y$ + ";"
  157. END SUB
  158.  
  159. SUB PPenDown
  160.   LPRINT "PD;"
  161. END SUB
  162.  
  163. SUB PPenUp
  164.   LPRINT "PU;"
  165. END SUB
  166.  
  167. SUB PPlotrelative (x%, y%)
  168.   x$ = STR$(x%): y$ = STR$(y%)
  169.   LPRINT "PR" + x$ + "," + y$ + ";"
  170. END SUB
  171.  
  172. SUB PPrint (s$)
  173.   LPRINT "LB" + s$ + CHR$(3) + ";"
  174. END SUB
  175.  
  176. SUB PPSet (x%, y%, col%)
  177.   PPenUp
  178.   PGetPen col%
  179.   PMove x%, y%
  180.   PPenDown
  181.   PPenUp
  182. END SUB
  183.  
  184. SUB PRectangleAbsolute (x%, y%)
  185.   x$ = STR$(x%)
  186.   y$ = STR$(y%)
  187.   LPRINT "EA" + x$ + "," + y$ + ";"
  188. END SUB
  189.  
  190. SUB PRectangleRelative (x%, y%)
  191.   x$ = STR$(x%)
  192.   y$ = STR$(y%)
  193.   LPRINT "ER" + x$ + "," + y$ + ";"
  194. END SUB
  195.  
  196. SUB PRelativeDirection (r%, rise%)
  197.   r$ = STR$(r%)
  198.   rise$ = STR$(rise%)
  199.   LPRINT "DR" + r$ + "," + rise$ + ";"
  200. END SUB
  201.  
  202. SUB PScale (xmin%, ymin%, xmax%, ymax%)
  203.   xmin$ = STR$(xmin%) + ",": ymin$ = STR$(ymin%) + ","
  204.   xmax$ = STR$(xmax%) + ",": ymax$ = STR$(ymax%) + ","
  205.   LPRINT "SC" + xmin$ + ymin$ + xmax$ + ymanx$ + ";"
  206. END SUB
  207.  
  208. SUB PScalingPoint (x1%, y1%, x2%, y2%)
  209.   x1$ = STR$(x1%) + ",": y1$ = STR$(y1%) + ","
  210.   x2$ = STR$(x2%) + ",": y2$ = STR$(y2%)
  211.   LPRINT "IP" + x1$ + y2$ + x2$ + y2$ + ";"
  212. END SUB
  213.  
  214. SUB PSegment (r%, start%, center%)
  215.   r$ = STR$(r%)
  216.   start$ = STR$(start%)
  217.   center$ = STR$(center%)
  218.   LPRINT "EW" + r$ + "," + start$ + "," + center$ + ";"
  219. END SUB
  220.  
  221. SUB PShadeRectAbsolute (x%, y%)
  222.   x$ = STR$(x%): y$ = STR$(y%)
  223.   LPRINT "RA" + x$ + "," + y$ + ";"
  224. END SUB
  225.  
  226. SUB PShadeRectRelative (x%, y%)
  227.   x$ = STR$(x%): y$ = STR$(y%)
  228.   LPRINT "RR" + x$ + "," + y$ + ";"
  229. END SUB
  230.  
  231. SUB PShadeSector (r%, start%, center%)
  232.   r$ = STR$(r%) + ","
  233.   start$ = STR$(start%): center$ = STR$(center%)
  234.   LPRINT "WG" + r$ + start$ + "," + center$ + ";"
  235. END SUB
  236.  
  237. SUB PSymbolMode (c$)
  238.   LPRINT "SM" + c$ + ";"
  239. END SUB
  240.  
  241. SUB PTextSize (wid!, size!, slant!)
  242.   wid$ = STR$(wid!): size$ = STR$(size!)
  243.   slant$ = STR$(slant!)
  244.   LPRINT "SI" + wid$ + "," + size$ + ";"
  245.   LPRINT "SL" + slant$ + ";"
  246. END SUB
  247.  
  248. SUB PWindow (x1%, y1%, x2%, y2%)
  249.   x1$ = STR$(x1%) + ",": y1$ = STR$(y1%) + ","
  250.   x2$ = STR$(x2%) + ",": y2$ = STR$(y2%)
  251.   LPRINT "IW" + x1$ + y1$ + x2$ + y2$ + ";"
  252. END SUB
  253. '* ------------------------------------------------------- *
  254. '*                 Ende von PLOT.BAS                       *
  255.