CARLA
 
载入中...
搜索中...
未找到
CityMapMeshTag.h
浏览该文件的文档.
1// Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7#pragma once
8
9/// 用于标识ProceduralMapGenerator所使用的网格的标签
10///
11///只要我们拥有的网格数少于255个,它就能正常工作,目前是蓝图阶段
12/// 类型枚举仅支持 uint8
13UENUM(BlueprintType)
14enum class ECityMapMeshTag : uint8
15{
16 RoadTwoLanes_LaneLeft UMETA(DisplayName = "Road: Two Lanes - Lane Left"),
17 RoadTwoLanes_LaneRight UMETA(DisplayName = "Road: Two Lanes - Lane Right"),
18 RoadTwoLanes_SidewalkLeft UMETA(DisplayName = "Road: Two Lanes - Sidewalk Left"),
19 RoadTwoLanes_SidewalkRight UMETA(DisplayName = "Road: Two Lanes - Sidewalk Right"),
20 RoadTwoLanes_LaneMarkingSolid UMETA(DisplayName = "Road: Two Lanes - Lane Marking Solid"),
21 RoadTwoLanes_LaneMarkingBroken UMETA(DisplayName = "Road: Two Lanes - Lane Marking Broken"),
22
23 Road90DegTurn_Lane0 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 0"),
24 Road90DegTurn_Lane1 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 1"),
25 Road90DegTurn_Lane2 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 2"),
26 Road90DegTurn_Lane3 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 3"),
27 Road90DegTurn_Lane4 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 4"),
28 Road90DegTurn_Lane5 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 5"),
29 Road90DegTurn_Lane6 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 6"),
30 Road90DegTurn_Lane7 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 7"),
31 Road90DegTurn_Lane8 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 8"),
32 Road90DegTurn_Lane9 UMETA(DisplayName = "Road: 90 Degree Turn - Lane 9"),
33 Road90DegTurn_Sidewalk0 UMETA(DisplayName = "Road: 90 Degree Turn - Sidewalk 0"),
34 Road90DegTurn_Sidewalk1 UMETA(DisplayName = "Road: 90 Degree Turn - Sidewalk 1"),
35 Road90DegTurn_Sidewalk2 UMETA(DisplayName = "Road: 90 Degree Turn - Sidewalk 2"),
36 Road90DegTurn_Sidewalk3 UMETA(DisplayName = "Road: 90 Degree Turn - Sidewalk 3"),
37 Road90DegTurn_LaneMarking UMETA(DisplayName = "Road: 90 Degree Turn - Lane Marking"),
38
39 RoadTIntersection_Lane0 UMETA(DisplayName = "Road: T-Intersection - Lane 0"),
40 RoadTIntersection_Lane1 UMETA(DisplayName = "Road: T-Intersection - Lane 1"),
41 RoadTIntersection_Lane2 UMETA(DisplayName = "Road: T-Intersection - Lane 2"),
42 RoadTIntersection_Lane3 UMETA(DisplayName = "Road: T-Intersection - Lane 3"),
43 RoadTIntersection_Lane4 UMETA(DisplayName = "Road: T-Intersection - Lane 4"),
44 RoadTIntersection_Lane5 UMETA(DisplayName = "Road: T-Intersection - Lane 5"),
45 RoadTIntersection_Lane6 UMETA(DisplayName = "Road: T-Intersection - Lane 6"),
46 RoadTIntersection_Lane7 UMETA(DisplayName = "Road: T-Intersection - Lane 7"),
47 RoadTIntersection_Lane8 UMETA(DisplayName = "Road: T-Intersection - Lane 8"),
48 RoadTIntersection_Lane9 UMETA(DisplayName = "Road: T-Intersection - Lane 9"),
49 RoadTIntersection_Sidewalk0 UMETA(DisplayName = "Road: T-Intersection - Sidewalk 0"),
50 RoadTIntersection_Sidewalk1 UMETA(DisplayName = "Road: T-Intersection - Sidewalk 1"),
51 RoadTIntersection_Sidewalk2 UMETA(DisplayName = "Road: T-Intersection - Sidewalk 2"),
52 RoadTIntersection_Sidewalk3 UMETA(DisplayName = "Road: T-Intersection - Sidewalk 3"),
53 RoadTIntersection_LaneMarking UMETA(DisplayName = "Road: T-Intersection - Lane Marking"),
54
55 RoadXIntersection_Lane0 UMETA(DisplayName = "Road: X-Intersection - Lane 0"),
56 RoadXIntersection_Lane1 UMETA(DisplayName = "Road: X-Intersection - Lane 1"),
57 RoadXIntersection_Lane2 UMETA(DisplayName = "Road: X-Intersection - Lane 2"),
58 RoadXIntersection_Lane3 UMETA(DisplayName = "Road: X-Intersection - Lane 3"),
59 RoadXIntersection_Lane4 UMETA(DisplayName = "Road: X-Intersection - Lane 4"),
60 RoadXIntersection_Lane5 UMETA(DisplayName = "Road: X-Intersection - Lane 5"),
61 RoadXIntersection_Lane6 UMETA(DisplayName = "Road: X-Intersection - Lane 6"),
62 RoadXIntersection_Lane7 UMETA(DisplayName = "Road: X-Intersection - Lane 7"),
63 RoadXIntersection_Lane8 UMETA(DisplayName = "Road: X-Intersection - Lane 8"),
64 RoadXIntersection_Lane9 UMETA(DisplayName = "Road: X-Intersection - Lane 9"),
65 RoadXIntersection_Sidewalk0 UMETA(DisplayName = "Road: X-Intersection - Sidewalk 0"),
66 RoadXIntersection_Sidewalk1 UMETA(DisplayName = "Road: X-Intersection - Sidewalk 1"),
67 RoadXIntersection_Sidewalk2 UMETA(DisplayName = "Road: X-Intersection - Sidewalk 2"),
68 RoadXIntersection_Sidewalk3 UMETA(DisplayName = "Road: X-Intersection - Sidewalk 3"),
69 RoadXIntersection_LaneMarking UMETA(DisplayName = "Road: X-Intersection - Lane Marking"),
70
71 NUMBER_OF_TAGS UMETA(Hidden),
72 INVALID UMETA(Hidden)
73};
74
75///用于处理 ECityMapMeshTag 的辅助类
77{
78public:
79
80 ///返回标签的数量
81 static constexpr uint8 GetNumberOfTags() {
82 return ToUInt(ECityMapMeshTag::NUMBER_OF_TAGS);
83 }
84
85 /// 返回基础网格。基础网格定义了地图缩放的单位图块
87
88 /// 获取道路交叉口一侧的图块大小。即,返回N,使得NxN
89 /// 大小相当于一个道路交叉口的部分
90 static uint32 GetRoadIntersectionSize();
91
92 /// @名称 标签转换
93 /// @{
94
95 /// Convert @a Tag to an unsigned integer type.
96 static constexpr uint8 ToUInt(ECityMapMeshTag Tag) {
97 return static_cast<uint8>(Tag);
98 }
99
100 /// 将@a标签转换为无符号整数类型
101 static ECityMapMeshTag FromUInt(uint8 Value) {
102 check(Value < GetNumberOfTags());
103 return static_cast<ECityMapMeshTag>(Value);
104 }
105
106 /// 获取一个标签名称作为 FString
107 static FString ToString(ECityMapMeshTag Tag);
108
109 /// 将 @a Value 转换为 ECityMapMeshTag 并获取其名称作为 FString
110 static FString ToString(uint8 Value) {
111 return ToString(FromUInt(Value));
112 }
113
114 /// @}
115};
static constexpr tag_size_t NUMBER_OF_TAGS
ECityMapMeshTag
用于标识ProceduralMapGenerator所使用的网格的标签
用于处理 ECityMapMeshTag 的辅助类
static FString ToString(uint8 Value)
将 Value 转换为 ECityMapMeshTag 并获取其名称作为 FString
static ECityMapMeshTag FromUInt(uint8 Value)
将 标签转换为无符号整数类型
static constexpr uint8 GetNumberOfTags()
返回标签的数量
static FString ToString(ECityMapMeshTag Tag)
获取一个标签名称作为 FString
static ECityMapMeshTag GetBaseMeshTag()
返回基础网格。基础网格定义了地图缩放的单位图块
static constexpr uint8 ToUInt(ECityMapMeshTag Tag)
@名称 标签转换
static uint32 GetRoadIntersectionSize()
获取道路交叉口一侧的图块大小。即,返回N,使得NxN 大小相当于一个道路交叉口的部分