CARLA
CityMapMeshTag.h
Go to the documentation of this file.
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 /// Tag to identify the meshes used by the ProceduralMapGenerator.
10 ///
11 /// It will work as long as we have less than 255 meshes, currently blueprint
12 /// type enums support uint8 only.
13 UENUM(BlueprintType)
14 enum 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 /// Helper class for working with ECityMapMeshTag.
77 {
78 public:
79 
80  /// Return the number of tags.
81  static constexpr uint8 GetNumberOfTags() {
83  }
84 
85  /// Return the base mesh. The base mesh defines the unit tile for map scaling.
87 
88  /// Get the size in tiles of a road intersection side. I.e., return N such NxN
89  /// is the size of a road intersection piece.
90  static uint32 GetRoadIntersectionSize();
91 
92  /// @name Tag conversions
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  /// Convert an unsigned integer to a ECityMapMeshTag.
101  static ECityMapMeshTag FromUInt(uint8 Value) {
102  check(Value < GetNumberOfTags());
103  return static_cast<ECityMapMeshTag>(Value);
104  }
105 
106  /// Get @a Tag name as FString.
107  static FString ToString(ECityMapMeshTag Tag);
108 
109  /// Convert @a Value to ECityMapMeshTag and get its name as FString.
110  static FString ToString(uint8 Value) {
111  return ToString(FromUInt(Value));
112  }
113 
114  /// @}
115 };
static FString ToString(ECityMapMeshTag Tag)
Get Tag name as FString.
static constexpr uint8 GetNumberOfTags()
Return the number of tags.
static ECityMapMeshTag FromUInt(uint8 Value)
Convert an unsigned integer to a ECityMapMeshTag.
Helper class for working with ECityMapMeshTag.
ECityMapMeshTag
Tag to identify the meshes used by the ProceduralMapGenerator.
static uint32 GetRoadIntersectionSize()
Get the size in tiles of a road intersection side.
static constexpr tag_size_t NUMBER_OF_TAGS
static ECityMapMeshTag GetBaseMeshTag()
Return the base mesh. The base mesh defines the unit tile for map scaling.
static constexpr uint8 ToUInt(ECityMapMeshTag Tag)
Convert Tag to an unsigned integer type.
static FString ToString(uint8 Value)
Convert Value to ECityMapMeshTag and get its name as FString.