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::EditorVertexSelectionVariable< Vertex > Class Template Reference

#include <EditorVertexSelection.h>

Inherits AzToolsFramework::EditorVertexSelectionBase< Vertex >, and AzToolsFramework::EditorVertexSelectionVariableRequestBus::Handler.

Public Member Functions

 EditorVertexSelectionVariable (EditorVertexSelectionVariable &&)=default
 
 EditorVertexSelectionVariable (const AZ::EntityComponentIdPair &entityComponentIdPair)
 
void DuplicateSelected ()
 
void DestroySelected ()
 
void DuplicateSelectedVertices () override
 
void DeleteSelectedVertices () override
 
void ClearVertexSelection () override
 
int GetSelectedVerticesCount () override
 
- Public Member Functions inherited from AzToolsFramework::EditorVertexSelectionBase< Vertex >
 EditorVertexSelectionBase (EditorVertexSelectionBase &&)=default
 
EditorVertexSelectionBaseoperator= (EditorVertexSelectionBase &&)=default
 
void Create (const AZ::EntityComponentIdPair &entityComponentIdPair, ManipulatorManagerId managerId, AZStd::unique_ptr< HoverSelection > hoverSelection, TranslationManipulators::Dimensions dimensions, TranslationManipulatorConfiguratorFn translationManipulatorConfigurator)
 Setup and configure the EditorVertexSelection for operation.
 
void CreateTranslationManipulator (const AZ::EntityComponentIdPair &entityComponentIdPair, ManipulatorManagerId managerId, const Vertex &vertex, size_t index)
 Create a translation manipulator for a given vertex.
 
void Destroy ()
 Destroy all manipulators associated with the vertex selection.
 
void SetVertexPositionsUpdatedCallback (const AZStd::function< void()> &callback)
 Set custom callback for when vertex positions are updated.
 
void RefreshLocal ()
 Update manipulators based on local changes to vertex positions.
 
void RefreshTranslationManipulator ()
 
void RefreshSpace (const AZ::Transform &worldFromLocal, const AZ::Vector3 &nonUniformScale=AZ::Vector3::CreateOne())
 Update manipulators based on changes to the entity's transform and non-uniform scale.
 
void SetBoundsDirty ()
 Set bounds dirty (need recalculating) for all owned manipulators (selection, translation, hover).
 
virtual bool HandleMouse (const ViewportInteraction::MouseInteractionEvent &mouseInteraction)
 How should the EditorVertexSelection respond to mouse input.
 
void SnapVerticesToSurface (const ViewportInteraction::MouseInteractionEvent &mouseInteraction)
 
AZStd::vector< ActionOverrideActionOverrides () const
 
void BeginBatchMovement ()
 
void EndBatchMovement ()
 
void SetSelectedPosition (const AZ::Vector3 &localPosition)
 Set the position of the TranslationManipulators (if active).
 
AZ::EntityId GetEntityId () const
 

Protected Member Functions

void SetupSelectionManipulator (const AZStd::shared_ptr< SelectionManipulator > &selectionManipulator, const AZ::EntityComponentIdPair &entityComponentIdPair, ManipulatorManagerId managerId, size_t vertIndex) override
 Internal interface for EditorVertexSelection.
 
virtual void ShowVertexDeletionWarning ()
 
- Protected Member Functions inherited from AzToolsFramework::EditorVertexSelectionBase< Vertex >
virtual void SetupSelectionManipulator (const AZStd::shared_ptr< SelectionManipulator > &selectionManipulator, const AZ::EntityComponentIdPair &entityComponentIdPair, ManipulatorManagerId managerId, size_t index)=0
 Internal interface for EditorVertexSelection.
 
virtual void PrepareActions ()=0
 
void SelectionManipulatorSelectCallback (size_t index, const ViewportInteraction::MouseInteraction &interaction, const AZ::EntityComponentIdPair &entityComponentIdPair, ManipulatorManagerId managerId)
 Default behavior when clicking on a selection manipulator (representing a vertex).
 
void ClearSelected ()
 Destroy the translation manipulator and deselect all vertices.
 
AZ::ComponentId GetComponentId () const
 
const AZ::EntityComponentIdPair & GetEntityComponentIdPair () const
 
ManipulatorManagerId GetManipulatorManagerId () const
 
TranslationManipulators::Dimensions Dimensions () const
 Is the translation vertex manipulator in 2D or 3D.
 
TranslationManipulatorConfiguratorFn ConfiguratorFn () const
 How to configure the translation manipulator (view and axes).
 
void SetState (State state)
 

Additional Inherited Members

- Protected Types inherited from AzToolsFramework::EditorVertexSelectionBase< Vertex >
enum class  State { Selecting , Translating }
 The state we are in when editing vertices.
 
- Protected Attributes inherited from AzToolsFramework::EditorVertexSelectionBase< Vertex >
AZStd::unique_ptr< HoverSelectionm_hoverSelection
 Interface to hover selection, representing bounds that can be selected.
 
AZStd::shared_ptr< IndexedTranslationManipulator< Vertex > > m_translationManipulator
 Manipulator when vertex is selected to translate it.
 
AZStd::vector< AZStd::shared_ptr< SelectionManipulator > > m_selectionManipulators
 Manipulators for each vertex when entity is selected.
 
AZStd::array< AZStd::vector< ActionOverride >, 2 > m_actionOverrides
 Available actions corresponding to each mode.
 

Detailed Description

template<typename Vertex>
class AzToolsFramework::EditorVertexSelectionVariable< Vertex >

EditorVertexSelectionVariable provides selection and editing for a variable length number of vertices. New vertices can be inserted/added or removed from the collection.

Member Function Documentation

◆ SetupSelectionManipulator()

template<typename Vertex >
void AzToolsFramework::EditorVertexSelectionVariable< Vertex >::SetupSelectionManipulator ( const AZStd::shared_ptr< SelectionManipulator > &  selectionManipulator,
const AZ::EntityComponentIdPair &  entityComponentIdPair,
ManipulatorManagerId  managerId,
size_t  index 
)
overrideprotectedvirtual

Internal interface for EditorVertexSelection.

Implements AzToolsFramework::EditorVertexSelectionBase< Vertex >.

◆ ShowVertexDeletionWarning()

template<typename Vertex >
virtual void AzToolsFramework::EditorVertexSelectionVariable< Vertex >::ShowVertexDeletionWarning ( )
protectedvirtual

Presents a warning to the user that vertices will not be deleted.

Note
Allow overriding by derived classes to make this a noop if required.

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