pixled-lib  1.0
geometry.h
1 #ifndef PIXLED_GEOMETRY_GEOMETRY_H
2 #define PIXLED_GEOMETRY_GEOMETRY_H
3 
4 #include "../function.h"
5 
6 namespace pixled { namespace geometry {
7 
13  class X : public base::Function<coordinate> {
14  public:
15  coordinate operator()(led l, time t) const override {
16  return l.location.x;
17  }
18 
19  X* copy() const override {return new X;}
20  };
21 
27  class Y : public base::Function<coordinate> {
28  public:
29  coordinate operator()(led l, time t) const override {
30  return l.location.y;
31  }
32 
33  Y* copy() const override {return new Y;}
34  };
35 
41  class I : public base::Function<index_t> {
42  public:
43  index_t operator()(led l, time t) const override {
44  return l.index;
45  }
46 
47  I* copy() const override {return new I;}
48  };
49 
57  class Distance : public Function<Distance, coordinate, point, point> {
58  public:
60 
61  coordinate operator()(led l, time t) const override;
62  };
63 
71  class LineDistance : public Function<LineDistance, coordinate, line, point> {
72  public:
74 
75  coordinate operator()(led l, time t) const override;
76  };
77 
91  class Point : public Function<Point, point, coordinate, coordinate> {
92  public:
94 
95  point operator()(led l, time t) const override;
96  };
97 
110  class AngleDeg : public Function<AngleDeg, angle, float> {
111  public:
113 
114  angle operator()(led l, time t) const override;
115  };
116 
129  class AngleRad : public Function<AngleRad, angle, float> {
130  public:
132 
133  angle operator()(led l, time t) const override;
134  };
135 
150  class Line : public Function<Line, line, coordinate, coordinate, coordinate> {
151  public:
153 
154  line operator()(led l, time t) const override;
155  };
156 
163  class XLine : public Function<XLine, line, coordinate> {
164  public:
166 
167  line operator()(led l, time t) const override;
168  };
169 
176  class YLine : public Function<YLine, line, coordinate> {
177  public:
179 
180  line operator()(led l, time t) const override;
181  };
182 
190  class AlphaLine : public Function<AlphaLine, line, point, angle> {
191  public:
193 
194  line operator()(led l, time t) const override;
195  };
196 
204  class PointLine : public Function<PointLine, line, point, point> {
205  public:
207 
208  line operator()(led l, time t) const override;
209  };
210 }}
211 #endif
Definition: function.h:349
Definition: geometry.h:52
Definition: function.h:33
Definition: geometry.h:190
line operator()(led l, time t) const override
Definition: geometry.cpp:43
Definition: geometry.h:110
angle operator()(led l, time t) const override
Definition: geometry.cpp:23
Definition: geometry.h:129
angle operator()(led l, time t) const override
Definition: geometry.cpp:27
Definition: geometry.h:57
coordinate operator()(led l, time t) const override
Definition: geometry.cpp:6
Definition: geometry.h:41
index_t operator()(led l, time t) const override
Definition: geometry.h:43
I * copy() const override
Definition: geometry.h:47
Definition: geometry.h:71
coordinate operator()(led l, time t) const override
Definition: geometry.cpp:12
Definition: geometry.h:150
line operator()(led l, time t) const override
Definition: geometry.cpp:31
Definition: geometry.h:204
line operator()(led l, time t) const override
Definition: geometry.cpp:47
Definition: geometry.h:91
point operator()(led l, time t) const override
Definition: geometry.cpp:19
Definition: geometry.h:163
line operator()(led l, time t) const override
Definition: geometry.cpp:35
Definition: geometry.h:13
X * copy() const override
Definition: geometry.h:19
coordinate operator()(led l, time t) const override
Definition: geometry.h:15
Definition: geometry.h:176
line operator()(led l, time t) const override
Definition: geometry.cpp:39
Definition: geometry.h:27
Y * copy() const override
Definition: geometry.h:33
coordinate operator()(led l, time t) const override
Definition: geometry.h:29
Definition: animation.cpp:3
std::size_t index_t
Definition: mapping.h:11
float coordinate
Definition: geometry.h:18
unsigned long time
Definition: time.h:10
Definition: mapping.h:19
index_t index
Definition: mapping.h:27
point location
Definition: mapping.h:23
Definition: geometry.h:134
Definition: geometry.h:23
coordinate x
Definition: geometry.h:27
coordinate y
Definition: geometry.h:31