23 if (
String ==
"Building")
return crp::CityObjectLabel::Buildings;
24 else if (
String ==
"Fence")
return crp::CityObjectLabel::Fences;
25 else if (
String ==
"Pedestrian")
return crp::CityObjectLabel::Pedestrians;
26 else if (
String ==
"Pole")
return crp::CityObjectLabel::Poles;
27 else if (
String ==
"Other")
return crp::CityObjectLabel::Other;
28 else if (
String ==
"Road")
return crp::CityObjectLabel::Roads;
29 else if (
String ==
"RoadLine")
return crp::CityObjectLabel::RoadLines;
30 else if (
String ==
"SideWalk")
return crp::CityObjectLabel::Sidewalks;
31 else if (
String ==
"TrafficSign")
return crp::CityObjectLabel::TrafficSigns;
32 else if (
String ==
"Vegetation")
return crp::CityObjectLabel::Vegetation;
33 else if (
String ==
"Car")
return crp::CityObjectLabel::Car;
34 else if (
String ==
"Wall")
return crp::CityObjectLabel::Walls;
35 else if (
String ==
"Sky")
return crp::CityObjectLabel::Sky;
36 else if (
String ==
"Ground")
return crp::CityObjectLabel::Ground;
37 else if (
String ==
"Bridge")
return crp::CityObjectLabel::Bridge;
38 else if (
String ==
"RailTrack")
return crp::CityObjectLabel::RailTrack;
39 else if (
String ==
"GuardRail")
return crp::CityObjectLabel::GuardRail;
40 else if (
String ==
"TrafficLight")
return crp::CityObjectLabel::TrafficLight;
41 else if (
String ==
"Static")
return crp::CityObjectLabel::Static;
42 else if (
String ==
"Dynamic")
return crp::CityObjectLabel::Dynamic;
43 else if (
String ==
"Water")
return crp::CityObjectLabel::Water;
44 else if (
String ==
"Terrain")
return crp::CityObjectLabel::Terrain;
45 else if (
String ==
"Truck")
return crp::CityObjectLabel::Truck;
46 else if (
String ==
"Motorcycle")
return crp::CityObjectLabel::Motorcycle;
47 else if (
String ==
"Bicycle")
return crp::CityObjectLabel::Bicycle;
48 else if (
String ==
"Bus")
return crp::CityObjectLabel::Bus;
49 else if (
String ==
"Rider")
return crp::CityObjectLabel::Rider;
50 else if (
String ==
"Train")
return crp::CityObjectLabel::Train;
51 else return crp::CityObjectLabel::None;
66 return (Label == crp::CityObjectLabel::Pedestrians ||
67 Label == crp::CityObjectLabel::TrafficSigns ||
68 Label == crp::CityObjectLabel::Car ||
69 Label == crp::CityObjectLabel::Train ||
70 Label == crp::CityObjectLabel::Bicycle ||
71 Label == crp::CityObjectLabel::Motorcycle ||
72 Label == crp::CityObjectLabel::Bus ||
73 Label == crp::CityObjectLabel::Rider ||
74 Label == crp::CityObjectLabel::Truck ||
75 Label == crp::CityObjectLabel::TrafficLight);
106#ifdef CARLA_TAGGER_EXTRA_LOG
107 UE_LOG(LogCarla, Log, TEXT(
"Actor: %s"), *Actor.GetName());
111 TArray<UStaticMeshComponent *> StaticMeshComponents;
112 Actor.GetComponents<UStaticMeshComponent>(StaticMeshComponents);
113 for (UStaticMeshComponent *Component : StaticMeshComponents) {
115 if (Label == crp::CityObjectLabel::Pedestrians &&
116 Cast<ACarlaWheeledVehicle>(&Actor))
118 Label = crp::CityObjectLabel::Rider;
121#ifdef CARLA_TAGGER_EXTRA_LOG
122 UE_LOG(LogCarla, Log, TEXT(
" + StaticMeshComponent: %s"), *Component->GetName());
123 UE_LOG(LogCarla, Log, TEXT(
" - Label: \"%s\""), *
GetTagAsString(Label));
126 if(!Component->IsVisible() || !Component->GetStaticMesh())
133 TArray<USceneComponent *> AttachedComponents = Component->GetAttachChildren();
134 for (USceneComponent *SceneComponent : AttachedComponents) {
135 UTaggedComponent *TaggedSceneComponent = Cast<UTaggedComponent>(SceneComponent);
136 if (
IsValid(TaggedSceneComponent)) {
137 TaggedComponent = TaggedSceneComponent;
138#ifdef CARLA_TAGGER_EXTRA_LOG
139 UE_LOG(LogCarla, Log, TEXT(
" - Found Tag"));
146 if (!TaggedComponent) {
147 TaggedComponent = NewObject<UTaggedComponent>(Component);
148 TaggedComponent->SetupAttachment(Component);
149 TaggedComponent->RegisterComponent();
150#ifdef CARLA_TAGGER_EXTRA_LOG
151 UE_LOG(LogCarla, Log, TEXT(
" - Added Tag"));
157#ifdef CARLA_TAGGER_EXTRA_LOG
158 UE_LOG(LogCarla, Log, TEXT(
" - Color: %s"), *Color.ToString());
162 TaggedComponent->MarkRenderStateDirty();
166 TArray<USkeletalMeshComponent *> SkeletalMeshComponents;
167 Actor.GetComponents<USkeletalMeshComponent>(SkeletalMeshComponents);
168 for (USkeletalMeshComponent *Component : SkeletalMeshComponents) {
170 if (Label == crp::CityObjectLabel::Pedestrians &&
171 Cast<ACarlaWheeledVehicle>(&Actor))
173 Label = crp::CityObjectLabel::Rider;
176#ifdef CARLA_TAGGER_EXTRA_LOG
177 UE_LOG(LogCarla, Log, TEXT(
" + SkeletalMeshComponent: %s"), *Component->GetName());
178 UE_LOG(LogCarla, Log, TEXT(
" - Label: \"%s\""), *
GetTagAsString(Label));
181 if(!Component->IsVisible() || !Component->GetSkeletalMeshRenderData())
188 TArray<USceneComponent *> AttachedComponents = Component->GetAttachChildren();
189 for (USceneComponent *SceneComponent : AttachedComponents) {
190 UTaggedComponent *TaggedSceneComponent = Cast<UTaggedComponent>(SceneComponent);
191 if (
IsValid(TaggedSceneComponent)) {
192 TaggedComponent = TaggedSceneComponent;
193#ifdef CARLA_TAGGER_EXTRA_LOG
194 UE_LOG(LogCarla, Log, TEXT(
" - Found Tag"));
201 if (!TaggedComponent) {
202 TaggedComponent = NewObject<UTaggedComponent>(Component);
203 TaggedComponent->SetupAttachment(Component);
204 TaggedComponent->RegisterComponent();
205#ifdef CARLA_TAGGER_EXTRA_LOG
206 UE_LOG(LogCarla, Log, TEXT(
" - Added Tag"));
212#ifdef CARLA_TAGGER_EXTRA_LOG
213 UE_LOG(LogCarla, Log, TEXT(
" - Color: %s"), *Color.ToString());
217 TaggedComponent->MarkRenderStateDirty();
218 TaggedComponent->SetComponentTickEnabled(
true);