Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::ComponentModeFramework::ComponentModeCollection Class Reference

Manages all individual ComponentModes for a single instance of Editor wide ComponentMode. More...

#include <ComponentModeCollection.h>

Inherits AzToolsFramework::ComponentModeCollectionInterface.

Public Member Functions

AZ_CLASS_ALLOCATOR_DECL void AddComponentMode (const AZ::EntityComponentIdPair &entityComponentIdPair, AZ::Uuid componentType, const ComponentModeFactoryFunction &componentModeBuilder)
 
void Refresh (const AZ::EntityComponentIdPair &entityComponentIdPair)
 Refresh (update) all active ComponentModes for the specified Entity and Component Id pair.
 
void BeginComponentMode ()
 
void EndComponentMode ()
 
void AddOtherSelectedEntityModes ()
 
bool InComponentMode () const
 Return if the Editor-wide ComponentMode state is active.
 
bool ModesAdded () const
 
bool AddedToComponentMode (const AZ::EntityComponentIdPair &entityComponentIdPair, const AZ::Uuid &componentType)
 Return if this Entity and its Component are currently in ComponentMode.
 
bool SelectNextActiveComponentMode ()
 Move to the next active ComponentMode so the Actions for that mode become available (it is now 'selected').
 
bool SelectPreviousActiveComponentMode ()
 Move to the previous active ComponentMode so the Actions for that mode become available (it is now 'selected').
 
bool SelectActiveComponentMode (const AZ::Uuid &componentType)
 Pick a specific ComponentMode for a Component (by directly selecting a Component in the EntityInspector - is it now 'selected').
 
AZ::Uuid ActiveComponentMode () const
 Return the Uuid of the Component Type that is currently active in Component Mode.
 
bool ComponentModeInstantiated (const AZ::EntityComponentIdPair &entityComponentIdPair) const
 Return if the ComponentMode for this specific Entity/Component pair is instantiated.
 
bool HasMultipleComponentTypes () const
 Return if there is more than one Component type in Component Mode.
 
void RefreshActions ()
 Refresh Actions (shortcuts) for the 'selected' ComponentMode.
 
void PopulateViewportUi ()
 
AZStd::vector< AZ::Uuid > GetComponentTypes () const override
 
void EnumerateActiveComponents (const ComponentModeCollectionInterface::ActiveComponentModeCB &callBack) const override
 
- Public Member Functions inherited from AzToolsFramework::ComponentModeCollectionInterface
 AZ_RTTI (ComponentModeCollectionInterface, "{DFAA4450-BBCD-47C0-9B91-FEA2DBD9B152}")
 
virtual AZStd::vector< AZ::Uuid > GetComponentTypes () const =0
 
virtual void EnumerateActiveComponents (const ActiveComponentModeCB &callBack) const =0
 

Additional Inherited Members

- Public Types inherited from AzToolsFramework::ComponentModeCollectionInterface
using ActiveComponentModeCB = AZStd::function< void(const AZ::EntityComponentIdPair &, const AZ::Uuid &)>
 Calls the handler function for each component mode that is currently active.
 

Detailed Description

Manages all individual ComponentModes for a single instance of Editor wide ComponentMode.

Member Function Documentation

◆ AddComponentMode()

AZ_CLASS_ALLOCATOR_DECL void AzToolsFramework::ComponentModeFramework::ComponentModeCollection::AddComponentMode ( const AZ::EntityComponentIdPair &  entityComponentIdPair,
AZ::Uuid  componentType,
const ComponentModeFactoryFunction componentModeBuilder 
)

Add a ComponentMode for a given Component type on the EntityId specified. An AZ::EntityComponentIdPair is provided so the individual Component on the Entity can be addressed if there are more than one of the same type.

◆ AddOtherSelectedEntityModes()

void AzToolsFramework::ComponentModeFramework::ComponentModeCollection::AddOtherSelectedEntityModes ( )

Ensure entire Entity selection is moved to ComponentMode. For all other selected entities, if they have a matching component that has just entered ComponentMode, add them too (duplicates will not be added - handled by AddComponentMode)

◆ BeginComponentMode()

void AzToolsFramework::ComponentModeFramework::ComponentModeCollection::BeginComponentMode ( )

Begin Editor-wide ComponentMode. Notify other systems a ComponentMode is starting and transition the Editor to the correct state.

◆ EndComponentMode()

void AzToolsFramework::ComponentModeFramework::ComponentModeCollection::EndComponentMode ( )

End Editor-wide ComponentMode Leave all active ComponentModes and move the Editor back to its normal state.

◆ EnumerateActiveComponents()

void AzToolsFramework::ComponentModeFramework::ComponentModeCollection::EnumerateActiveComponents ( const ComponentModeCollectionInterface::ActiveComponentModeCB callBack) const
overridevirtual

◆ GetComponentTypes()

AZStd::vector< AZ::Uuid > AzToolsFramework::ComponentModeFramework::ComponentModeCollection::GetComponentTypes ( ) const
overridevirtual

Retrieves the list of all component types (usually one).

Note
If called outside of component mode, an empty vector will be returned.

Implements AzToolsFramework::ComponentModeCollectionInterface.

◆ ModesAdded()

bool AzToolsFramework::ComponentModeFramework::ComponentModeCollection::ModesAdded ( ) const
inline

Are ComponentModes in the process of being added. Used to determine if other selected entities with the same Component type should also be added.

◆ PopulateViewportUi()

void AzToolsFramework::ComponentModeFramework::ComponentModeCollection::PopulateViewportUi ( )

Populate Viewport UI elements to use for this ComponentMode. Called once each time a ComponentMode is added.


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