From 06910a7c82ad6440458eed024fcfb6fe8fd5e0fa Mon Sep 17 00:00:00 2001 From: John Date: Wed, 13 Oct 2021 18:58:43 +0100 Subject: [PATCH] Add API comments. Signed-off-by: John --- .../ViewportSelection/EditorHelpers.cpp | 2 +- .../AzToolsFramework/ViewportSelection/EditorHelpers.h | 10 +++++++++- .../EditorTransformComponentSelection.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp index 933a8c9ee4..7cdd87d0ae 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.cpp @@ -136,7 +136,7 @@ namespace AzToolsFramework return m_rootEntityId; } - bool EntityIdUnderCursor::IsChildEntity() const + bool EntityIdUnderCursor::IsPrefabEntity() const { return m_entityId != m_rootEntityId; } diff --git a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h index 0a108c709a..cd99087852 100644 --- a/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h +++ b/Code/Framework/AzToolsFramework/AzToolsFramework/ViewportSelection/EditorHelpers.h @@ -36,9 +36,17 @@ namespace AzToolsFramework EntityIdUnderCursor(AZ::EntityId entityId); EntityIdUnderCursor(AZ::EntityId entityId, AZ::EntityId rootEntityId); + //! Returns the entity id under the cursor (if any). + //! @note In the case of no entity id under the cursor, an invalid entity id is returned. AZ::EntityId GetEntityId() const; + + //! Returns the root entity id if the entity id under the cursor is part of a prefab, otherwise returns the entity id. + //! @note In the case of no entity id under the cursor, an invalid entity id is returned. AZ::EntityId GetRootEntityId() const; - bool IsChildEntity() const; + + //! Returns true if the entity id under the cursor is part of a prefab, otherwise false. + //! @note In the case of no entity id under the cursor, true is returned (although consider this behavior undefined). + bool IsPrefabEntity() const; private: AZ::EntityId m_entityId; //::Get(); if (prefabFocusInterface)