1 package org.opentrafficsim.animation.data;
2
3 import org.djutils.draw.point.Point2d;
4 import org.opentrafficsim.base.geometry.BoundingRectangle;
5 import org.opentrafficsim.base.geometry.OtsBounds2d;
6 import org.opentrafficsim.core.gtu.GtuGenerator.GtuGeneratorPosition;
7 import org.opentrafficsim.draw.road.GtuGeneratorPositionAnimation.GtuGeneratorPositionData;
8
9
10
11
12
13
14
15
16
17 public class AnimationGtuGeneratorPositionData implements GtuGeneratorPositionData
18 {
19
20
21 private final GtuGeneratorPosition position;
22
23
24
25
26
27 public AnimationGtuGeneratorPositionData(final GtuGeneratorPosition position)
28 {
29 this.position = position;
30 }
31
32
33 @Override
34 public Point2d getLocation()
35 {
36 return this.position.getLocation();
37 }
38
39
40 @Override
41 public OtsBounds2d getBounds()
42 {
43
44 return new BoundingRectangle(0.0, 4.75, -1.0, 1.0);
45 }
46
47
48 @Override
49 public int getQueueCount()
50 {
51 return this.position.getQueueCount();
52 }
53
54
55
56
57
58 public GtuGeneratorPosition getGeneratorPosition()
59 {
60 return this.position;
61 }
62
63
64 @Override
65 public String toString()
66 {
67 return "Generator position " + this.position.getId();
68 }
69
70 }