CARLA
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
ATagger Class Reference

Sets actors' custom depth stencil value for semantic segmentation according to their meshes. More...

#include <Tagger.h>

+ Inheritance diagram for ATagger:
+ Collaboration diagram for ATagger:

Public Member Functions

 ATagger ()
 

Static Public Member Functions

static FLinearColor GetActorLabelColor (const AActor &Actor, const crp::CityObjectLabel &Label)
 
static crp::CityObjectLabel GetLabelByFolderName (const FString &String)
 Method that computes the label corresponding to a folder path. More...
 
template<typename T >
static crp::CityObjectLabel GetLabelByPath (const T *Object)
 Method that computes the label corresponding to an specific object using the folder path in which it is stored. More...
 
static FString GetTagAsString (crp::CityObjectLabel Tag)
 Retrieve the tags of an already tagged actor. More...
 
static crp::CityObjectLabel GetTagOfTaggedComponent (const UPrimitiveComponent &Component)
 Retrieve the tag of an already tagged component. More...
 
static void GetTagsOfTaggedActor (const AActor &Actor, TSet< crp::CityObjectLabel > &Tags)
 Retrieve the tags of an already tagged actor. More...
 
static bool IsThing (const crp::CityObjectLabel &Label)
 
static bool MatchComponent (const UPrimitiveComponent &Component, crp::CityObjectLabel Tag)
 Return true if Component has been tagged with the given Tag. More...
 
static void SetStencilValue (UPrimitiveComponent &Component, const crp::CityObjectLabel &Label, const bool bSetRenderCustomDepth)
 
static void TagActor (const AActor &Actor, bool bTagForSemanticSegmentation)
 Set the tag of an actor. More...
 
static void TagActorsInLevel (UWorld &World, bool bTagForSemanticSegmentation)
 Set the tag of every actor in level. More...
 
static void TagActorsInLevel (ULevel &Level, bool bTagForSemanticSegmentation)
 

Private Attributes

bool bTagForSemanticSegmentation = false
 
bool bTriggerTagObjects = false
 

Detailed Description

Sets actors' custom depth stencil value for semantic segmentation according to their meshes.

Non-static functions present so it can be dropped into the scene for testing purposes.

Definition at line 26 of file Tagger.h.

Constructor & Destructor Documentation

◆ ATagger()

ATagger::ATagger ( )

Definition at line 293 of file Tagger.cpp.

References bTagForSemanticSegmentation, bTriggerTagObjects, and TagActorsInLevel().

+ Here is the call graph for this function:

Member Function Documentation

◆ GetActorLabelColor()

FLinearColor ATagger::GetActorLabelColor ( const AActor Actor,
const crp::CityObjectLabel Label 
)
static

Definition at line 83 of file Tagger.cpp.

References CastEnum().

Referenced by TagActor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetLabelByFolderName()

crp::CityObjectLabel ATagger::GetLabelByFolderName ( const FString &  String)
static

Method that computes the label corresponding to a folder path.

Definition at line 27 of file Tagger.cpp.

References carla::rpc::None, carla::rpc::Other, carla::rpc::TrafficLight, and carla::rpc::TrafficSigns.

◆ GetLabelByPath()

template<typename T >
static crp::CityObjectLabel ATagger::GetLabelByPath ( const T *  Object)
inlinestatic

Method that computes the label corresponding to an specific object using the folder path in which it is stored.

Definition at line 77 of file Tagger.h.

References carla::rpc::None.

Referenced by TagActor().

+ Here is the caller graph for this function:

◆ GetTagAsString()

FString ATagger::GetTagAsString ( crp::CityObjectLabel  Tag)
static

Retrieve the tags of an already tagged actor.

CityObjectLabel::None is not added to the array.

Definition at line 250 of file Tagger.cpp.

References CARLA_GET_LABEL_STR, Other, and TrafficLight.

Referenced by CarlaGetRelevantTagAsString(), UObjectRegister::RegisterTrafficLight(), and TagActor().

+ Here is the caller graph for this function:

◆ GetTagOfTaggedComponent()

static crp::CityObjectLabel ATagger::GetTagOfTaggedComponent ( const UPrimitiveComponent Component)
inlinestatic

Retrieve the tag of an already tagged component.

Definition at line 52 of file Tagger.h.

Referenced by URayTracer::CastRay(), ACarlaGameModeBase::EnableOverlapEvents(), UBoundingBoxCalculator::GetBBsOfActor(), UBoundingBoxCalculator::GetBBsOfSkeletalMeshComponents(), UBoundingBoxCalculator::GetBBsOfStaticMeshComponents(), GetTagsOfTaggedActor(), UBoundingBoxCalculator::GetVehicleBoundingBox(), URayTracer::ProjectPoint(), UObjectRegister::RegisterISMComponents(), and UObjectRegister::RegisterVehicle().

+ Here is the caller graph for this function:

◆ GetTagsOfTaggedActor()

void ATagger::GetTagsOfTaggedActor ( const AActor Actor,
TSet< crp::CityObjectLabel > &  Tags 
)
static

Retrieve the tags of an already tagged actor.

CityObjectLabel::None is not added to the array.

Definition at line 236 of file Tagger.cpp.

References GetTagOfTaggedComponent(), and carla::rpc::None.

Referenced by FActorRegistry::MakeCarlaActor(), and UCarlaEpisode::SerializeActor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsThing()

bool ATagger::IsThing ( const crp::CityObjectLabel Label)
static

Definition at line 69 of file Tagger.cpp.

References carla::rpc::TrafficLight, and carla::rpc::TrafficSigns.

◆ MatchComponent()

static bool ATagger::MatchComponent ( const UPrimitiveComponent Component,
crp::CityObjectLabel  Tag 
)
inlinestatic

Return true if Component has been tagged with the given Tag.

Definition at line 62 of file Tagger.h.

References String.

Referenced by LineTrace().

+ Here is the caller graph for this function:

◆ SetStencilValue()

void ATagger::SetStencilValue ( UPrimitiveComponent Component,
const crp::CityObjectLabel Label,
const bool  bSetRenderCustomDepth 
)
static

Definition at line 59 of file Tagger.cpp.

References CastEnum(), and carla::rpc::None.

Referenced by TagActor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TagActor()

void ATagger::TagActor ( const AActor Actor,
bool  bTagForSemanticSegmentation 
)
static

Set the tag of an actor.

If bTagForSemanticSegmentation true, activate the custom depth pass. This pass is necessary for rendering the semantic segmentation. However, it may add a performance penalty since occlusion doesn't seem to be applied to objects having this value active.

Definition at line 103 of file Tagger.cpp.

References GetActorLabelColor(), GetLabelByPath(), GetTagAsString(), IsValid(), UTaggedComponent::SetColor(), and SetStencilValue().

Referenced by UTaggerDelegate::OnActorSpawned(), UActorDispatcher::SpawnActor(), and TagActorsInLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TagActorsInLevel() [1/2]

void ATagger::TagActorsInLevel ( UWorld &  World,
bool  bTagForSemanticSegmentation 
)
static

Set the tag of every actor in level.

If bTagForSemanticSegmentation true, activate the custom depth pass. This pass is necessary for rendering the semantic segmentation. However, it may add a performance penalty since occlusion doesn't seem to be applied to objects having this value active.

Definition at line 222 of file Tagger.cpp.

References TagActor().

Referenced by ATagger(), ACarlaGameModeBase::BeginPlay(), ACityMapGenerator::GenerateRoadMap(), ALargeMapManager::OnLevelAddedToWorld(), and ACarlaGameModeBase::OnLoadStreamLevel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TagActorsInLevel() [2/2]

void ATagger::TagActorsInLevel ( ULevel &  Level,
bool  bTagForSemanticSegmentation 
)
static

Definition at line 229 of file Tagger.cpp.

References TagActor().

+ Here is the call graph for this function:

Member Data Documentation

◆ bTagForSemanticSegmentation

bool ATagger::bTagForSemanticSegmentation = false
private

Definition at line 105 of file Tagger.h.

Referenced by ATagger().

◆ bTriggerTagObjects

bool ATagger::bTriggerTagObjects = false
private

Definition at line 102 of file Tagger.h.

Referenced by ATagger().


The documentation for this class was generated from the following files: