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::EditorBoxSelect Class Reference

#include <EditorBoxSelect.h>

Public Member Functions

bool Active () const
 Return if a box select action is currently taking place.
 
bool HandleMouseInteraction (const ViewportInteraction::MouseInteractionEvent &mouseInteraction)
 
void Display2d (const AzFramework::ViewportInfo &viewportInfo, AzFramework::DebugDisplayRequests &debugDisplay)
 Responsible for drawing the 2d box representing the selection in screen space.
 
void DisplayScene (const AzFramework::ViewportInfo &viewportInfo, AzFramework::DebugDisplayRequests &debugDisplay)
 Custom drawing behavior to happen during a box select.
 
void InstallLeftMouseDown (const AZStd::function< void(const ViewportInteraction::MouseInteractionEvent &mouseInteraction)> &leftMouseDown)
 Set the left mouse down callback.
 
void InstallMouseMove (const AZStd::function< void(const ViewportInteraction::MouseInteractionEvent &mouseInteraction)> &mouseMove)
 Set the mouse move callback.
 
void InstallLeftMouseUp (const AZStd::function< void()> &leftMouseUp)
 Set the left mouse up callback.
 
void InstallDisplayScene (const AZStd::function< void(const AzFramework::ViewportInfo &viewportInfo, AzFramework::DebugDisplayRequests &debugDisplay)> &displayScene)
 Set the display scene callback.
 
const AZStd::optional< QRect > & BoxRegion () const
 
ViewportInteraction::KeyboardModifiers PreviousModifiers () const
 Return the active modifiers from the previous frame.
 

Detailed Description

Utility to provide box select (click and drag) support for viewport types. Users can override the mouse event callbacks and display scene function to customize behavior.

Member Function Documentation

◆ BoxRegion()

const AZStd::optional< QRect > & AzToolsFramework::EditorBoxSelect::BoxRegion ( ) const
inline

Return the box select region. If a box selection is being made, return the current rectangle representing the area. If there is currently no active box select, then the Maybe type will be empty (there will be no region/area).

◆ HandleMouseInteraction()

bool AzToolsFramework::EditorBoxSelect::HandleMouseInteraction ( const ViewportInteraction::MouseInteractionEvent mouseInteraction)

Update the box select for various mouse events. Call HandleMouseInteraction from type/system implementing MouseViewportRequests interface.

Returns
Returns true if box select is active.

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