Open 3D Engine LyShine Gem 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.
ViewportWidget Class Reference

Inherits AtomToolsFramework::RenderViewportWidget, AzToolsFramework::EditorPickModeNotificationBus::Handler, FontNotificationBus::Handler, LyShinePassDataRequestBus::Handler, and AZ::RPI::ViewportContextNotificationBus::Handler.

Public Types

enum  DrawElementBorders { DrawElementBorders_Unselected = 0x1 , DrawElementBorders_Visual = 0x2 , DrawElementBorders_Parent = 0x4 , DrawElementBorders_Hidden = 0x8 }
 

Public Member Functions

 ViewportWidget (EditorWindow *parent)
 
ViewportInteractionGetViewportInteraction ()
 
bool IsDrawingElementBorders (uint32 flags) const
 
void ToggleDrawElementBorders (uint32 flags)
 
void ActiveCanvasChanged ()
 
void EntityContextChanged ()
 
void Refresh ()
 Flags the viewport display as needing a refresh.
 
void ClearUntilSafeToRedraw ()
 Used to clear the viewport and prevent rendering until the viewport layout updates.
 
void SetRedrawEnabled (bool enabled)
 Set whether to render the canvas.
 
float GetPreviewCanvasScale ()
 Get the canvas scale factor being used for the preview mode.
 
ViewportHighlightGetViewportHighlight ()
 Used by ViewportInteraction for drawing.
 
AZ::Vector2 GetRenderViewportSize () const
 Get the size of the RPI render viewport.
 
float WidgetToViewportFactor () const
 Get the widget to viewport scale factor.
 
bool IsInObjectPickMode ()
 
void PickItem (AZ::EntityId entityId)
 
QWidget * CreateViewportWithRulersWidget (QWidget *parent)
 
void ShowRulers (bool show)
 
bool AreRulersShown ()
 
void RefreshRulers ()
 
void SetRulerCursorPositions (const QPoint &globalPos)
 
void ShowGuides (bool show)
 
bool AreGuidesShown ()
 
void InitUiRenderer ()
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *e) override
 
void mousePressEvent (QMouseEvent *ev) override
 
void mouseMoveEvent (QMouseEvent *ev) override
 
void mouseReleaseEvent (QMouseEvent *ev) override
 
void wheelEvent (QWheelEvent *ev) override
 
bool eventFilter (QObject *watched, QEvent *event) override
 Prevents shortcuts from interfering with preview mode.
 
bool event (QEvent *ev) override
 Handle events from Qt.
 
void keyPressEvent (QKeyEvent *event) override
 Key press event from Qt.
 
void keyReleaseEvent (QKeyEvent *event) override
 Key release event from Qt.
 
void focusOutEvent (QFocusEvent *ev) override
 

Member Function Documentation

◆ mouseMoveEvent()

void ViewportWidget::mouseMoveEvent ( QMouseEvent *  ev)
overrideprotected

Forwards mouse move events to ViewportInteraction.

Event is NOT propagated to parent class.

◆ mousePressEvent()

void ViewportWidget::mousePressEvent ( QMouseEvent *  ev)
overrideprotected

Forwards mouse press events to ViewportInteraction.

Event is NOT propagated to parent class.

◆ mouseReleaseEvent()

void ViewportWidget::mouseReleaseEvent ( QMouseEvent *  ev)
overrideprotected

Forwards mouse release events to ViewportInteraction.

Event is NOT propagated to parent class.

◆ wheelEvent()

void ViewportWidget::wheelEvent ( QWheelEvent *  ev)
overrideprotected

Forwards mouse wheel events to ViewportInteraction.

Event is propagated to parent class.


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