Agrarsense
|
#include <ActorInformation.h>
Public Member Functions | |
FString | GetActorID () const |
FString | GetActorName () const |
FString | GetActorInformation () const |
void | SetActorName (const FString &NewActorName) |
void | SetActorIDAndName (const FString &NewActorName, const FString &NewID) |
Static Public Member Functions | |
static void | SetAndValidateActorIDAndName (FString &ActorName, FString &ActorID, TWeakObjectPtr< AActor > Actor) |
static bool | DestroyActorByID (const FString &ID) |
static AActor * | GetActorByID (const FString &ID) |
template<typename T > | |
static TArray< T * > | GetActorsWithInterface () |
static void | PrintAllIds () |
Static Private Member Functions | |
static FString | ValidateID (const FString &ActorID, TWeakObjectPtr< AActor > Actor) |
static FString | GenerateUniqueID () |
Interface for actors with an ID.
Definition at line 22 of file ActorInformation.h.
|
static |
Try to Destroy Actor by its ID.
ID | Actor ID |
Definition at line 96 of file ActorInformation.cpp.
Referenced by UROSCommands::HandleTryDestroyObjectByID().
|
staticprivate |
Generate unique ID.
Definition at line 62 of file ActorInformation.cpp.
Referenced by SetAndValidateActorIDAndName().
|
static |
Try to find Actor by ID
ID | Actor ID |
Definition at line 122 of file ActorInformation.cpp.
Referenced by UROSCommands::HandleChangeOverlapSensorBounds(), UROSCommands::HandleChangeOverlapSensorPosition(), UROSCommands::HandleMoveDroneTo(), UROSCommands::HandleMoveWalkerTo(), UROSCommands::HandleSetSensorEnabled(), UROSCommands::HandleSetWalkerMovement(), and UROSCommands::HandleTeleportActorByID().
FString IActorInformation::GetActorID | ( | ) | const |
Get Actor ID. This ID can be used to destroy or otherwise control actor through ROS.
FString IActorInformation::GetActorInformation | ( | ) | const |
Get Actor information.
FString IActorInformation::GetActorName | ( | ) | const |
Get Actor name. This is for UI related things.
|
static |
Retrieves an array of actors with IActorID interface.
T | The interface class type. |
Definition at line 152 of file ActorInformation.cpp.
|
static |
Print all ID's.
Definition at line 177 of file ActorInformation.cpp.
References ExistingIDs, and SimulatorLog::Log().
Referenced by UROSCommands::HandlePrintIds().
void IActorInformation::SetActorIDAndName | ( | const FString & | NewActorName, |
const FString & | NewID | ||
) |
Set Actor ID and name.
void IActorInformation::SetActorName | ( | const FString & | NewActorName | ) |
Set Actor name. This is for UI related things.
|
static |
Sets and validates the Actor's name and ID. This function ensures the Actor's name is non-empty and generates a unique ID if needed.
ActorName | [in, out] Reference to the Actor's name. Set to the label if empty. |
ActorID | [in, out] Reference to the Actor's ID. Validated and set to a unique ID if empty. |
Actor | [in] Pointer to the Actor. Must not be nullptr. |
Definition at line 67 of file ActorInformation.cpp.
References GenerateUniqueID(), and ValidateID().
Referenced by AVehicle::SetActorIDAndName_Implementation().
|
staticprivate |
Validate that the ID is unique.
Definition at line 28 of file ActorInformation.cpp.
References IdentifierData::Actor, IdentifierData::Count, and ExistingIDs.
Referenced by SetAndValidateActorIDAndName().