Line | |
---|
1 | using System.Drawing;
|
---|
2 |
|
---|
3 | namespace HeuristicLab.Visualization {
|
---|
4 | public class Grid : WorldShape {
|
---|
5 | public override void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) {
|
---|
6 | shapes.Clear();
|
---|
7 |
|
---|
8 | foreach (double y in XAxis.GetTicks(YAxis.PixelsPerInterval,
|
---|
9 | viewport.Height,
|
---|
10 | ClippingArea.Height,
|
---|
11 | ClippingArea.Y1)) {
|
---|
12 | LineShape line = new LineShape(ClippingArea.X1, y,
|
---|
13 | ClippingArea.X2, y,
|
---|
14 | 0, Color.LightBlue, 1, DrawingStyle.Dashed);
|
---|
15 | shapes.Add(line);
|
---|
16 | }
|
---|
17 |
|
---|
18 | foreach (double x in XAxis.GetTicks(XAxis.PixelsPerInterval,
|
---|
19 | viewport.Width,
|
---|
20 | ClippingArea.Width,
|
---|
21 | ClippingArea.X1)) {
|
---|
22 | LineShape line = new LineShape(x, ClippingArea.Y1,
|
---|
23 | x, ClippingArea.Y2,
|
---|
24 | 0, Color.LightBlue, 1, DrawingStyle.Dashed);
|
---|
25 | shapes.Add(line);
|
---|
26 | }
|
---|
27 |
|
---|
28 | LineShape lineZeroX = new LineShape(0, ClippingArea.Y1,
|
---|
29 | 0, ClippingArea.Y2,
|
---|
30 | 0, Color.LightBlue, 3, DrawingStyle.Dashed);
|
---|
31 |
|
---|
32 | LineShape lineZeroY = new LineShape(ClippingArea.X1, 0,
|
---|
33 | ClippingArea.X2, 0,
|
---|
34 | 0, Color.LightBlue, 3, DrawingStyle.Dashed);
|
---|
35 |
|
---|
36 | shapes.Add(lineZeroX);
|
---|
37 | shapes.Add(lineZeroY);
|
---|
38 |
|
---|
39 | base.Draw(graphics, viewport, clippingArea);
|
---|
40 | }
|
---|
41 | }
|
---|
42 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.