forked from pageldev/libOpenDRIVE
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRoadObject.h
81 lines (64 loc) · 1.69 KB
/
RoadObject.h
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#pragma once
#include "Mesh.h"
#include "Utils.hpp"
#include "XmlNode.h"
#include <memory>
#include <set>
#include <vector>
namespace odr
{
class Road;
struct RoadObjectRepeat : public XmlNode
{
double s0 = 0;
double length = 0;
double distance = 0;
double t_start = 0;
double t_end = 0;
double width_start = 0;
double width_end = 0;
double height_start = 0;
double height_end = 0;
double z_offset_start = 0;
double z_offset_end = 0;
};
struct RoadObjectCorner : public XmlNode
{
enum class Type
{
Local_RelZ, // z relative to road’s reference line
Local_AbsZ, // absolute z value
Road
};
Vec3D pt;
double height = 0;
Type type = Type::Road;
};
struct RoadObject : public XmlNode
{
RoadObject() = default;
Mesh3D get_mesh(double eps) const;
static Mesh3D get_cylinder(double eps, double radius, double height);
static Mesh3D get_box(double width, double length, double height);
std::string id;
std::string type;
std::string name;
std::string orientation;
double s0 = 0;
double t0 = 0;
double z0 = 0;
double length = 0;
double valid_length = 0;
double width = 0;
double radius = 0;
double height = 0;
double hdg = 0;
double pitch = 0;
double roll = 0;
std::vector<RoadObjectRepeat> repeats;
std::vector<RoadObjectCorner> outline;
std::weak_ptr<Road> road;
};
using ConstRoadObjectSet = std::set<std::shared_ptr<const RoadObject>, SharedPtrCmp<const RoadObject, std::string, &RoadObject::id>>;
using RoadObjectSet = std::set<std::shared_ptr<RoadObject>, SharedPtrCmp<RoadObject, std::string, &RoadObject::id>>;
} // namespace odr