-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlineedge.h
More file actions
48 lines (40 loc) · 921 Bytes
/
lineedge.h
File metadata and controls
48 lines (40 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef LINEEDGE_H
#define LINEEDGE_H
#include <vector>
#include <point_2d.h>
namespace htwk {
class LineSegment;
class LineEdge {
public:
std::vector<LineSegment*> segments;
float px1, py1, px2, py2;
float nx;
float ny;
float d;
// center of the line
float x;
float y;
int id;
int matchCnt;
bool straight;
bool valid;
LineEdge();
~LineEdge() = default;
LineEdge(const LineEdge&) = default;
LineEdge(LineEdge&&) = default;
LineEdge& operator=(const LineEdge&) = default;
LineEdge& operator=(LineEdge&&) = default;
LineEdge(int id);
LineEdge(std::vector<LineSegment*> seg);
point_2d p1() const {
return {px1, py1};
}
point_2d p2() const {
return {px2, py2};
}
void update();
void setVector(float vx, float vy);
float estimateLineWidth() const;
};
} // namespace htwk
#endif // LINEEDGE_H