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::EditorRequests Class Referenceabstract

#include <ToolsApplicationAPI.h>

Inherits AZ::EBusTraits.

Public Types

using Bus = AZ::EBus< EditorRequests >
 
typedef AZStd::function< QWidget *(QWidget *)> WidgetCreationFunc
 

Public Member Functions

virtual void RegisterViewPane (const char *, const char *, const ViewPaneOptions &, const WidgetCreationFunc &)
 
virtual void RegisterCustomViewPane (const char *, const char *, const ViewPaneOptions &)
 
virtual void UnregisterViewPane (const char *)
 
virtual QWidget * GetViewPaneWidget (const char *)
 
void ShowViewPane (const char *paneName)
 Show an Editor window by name.
 
virtual void OpenViewPane (const char *)
 Opens an Editor window by name. Shows it if it was previously hidden, and activates it even if it's already visible.
 
virtual QDockWidget * InstanceViewPane (const char *)
 Opens a new instance of an Editor window by name and returns the dock widget container.
 
virtual void CloseViewPane (const char *)
 
virtual void BrowseForAssets (AssetBrowser::AssetSelectionModel &)=0
 Spawn asset browser for the appropriate asset types.
 
virtual void CreateEditorRepresentation (AZ::Entity *)
 Creates editor-side representation of an underlying entity.
 
virtual bool DestroyEditorRepresentation (AZ::EntityId, bool)
 Destroys editor-side representation of a given entity.
 
virtual void CloneSelection (bool &)
 Clone selected entities/slices.
 
virtual void DeleteSelectedEntities (bool)
 Delete selected entities/slices.
 
virtual AZ::EntityId CreateNewEntity (AZ::EntityId parentId=AZ::EntityId())
 Create a new entity at a default position.
 
virtual AZ::EntityId CreateNewEntityAsChild (AZ::EntityId)
 Create a new entity as a child of an existing entity - Intended only to handle explicit requests from the user.
 
virtual AZ::EntityId CreateNewEntityAtPosition (const AZ::Vector3 &, AZ::EntityId parentId=AZ::EntityId())
 Create a new entity at a specified position.
 
virtual AZ::EntityId GetExistingEntity (AZ::u64 id)
 Gets and existing EntityId from a known id passed ad a u64.
 
virtual AzFramework::EntityContextId GetEntityContextId ()
 
virtual QWidget * GetMainWindow ()
 Retrieve the main application window.
 
virtual IEditor * GetEditor ()
 Retrieve main editor interface.
 
virtual bool GetUndoSliceOverrideSaveValue ()
 
virtual bool GetShowCircularDependencyError ()
 Retrieve the setting for messaging.
 
virtual void SetShowCircularDependencyError (const bool &)
 Hide or show the circular dependency error when saving slices.
 
virtual void LaunchLuaEditor (const char *)
 Launches the Lua editor and opens the specified (space separated) files.
 
virtual bool IsLevelDocumentOpen ()
 Returns whether a level document is open.
 
virtual AZStd::string GetLevelName ()
 Return the name of a level document.
 
virtual AZStd::string GetDefaultComponentViewportIcon ()
 Return default icon to show in the viewport for components that haven't specified an icon.
 
virtual AZStd::string GetDefaultComponentEditorIcon ()
 Return default icon to show in the palette, etc for components that haven't specified an icon.
 
virtual AZStd::string GetDefaultEntityIcon ()
 Return default entity icon to show both in viewport and entity-inspector.
 
virtual AZStd::string GetComponentEditorIcon (const AZ::Uuid &, const AZ::Component *)
 
virtual AZStd::string GetComponentTypeEditorIcon (const AZ::Uuid &)
 
virtual AZStd::string GetComponentIconPath (const AZ::Uuid &, AZ::Crc32, const AZ::Component *)
 
virtual float CalculateAgentNavigationRadius (const char *)
 
virtual const char * GetDefaultAgentNavigationTypeName ()
 
virtual void OpenPinnedInspector (const AzToolsFramework::EntityIdSet &)
 
virtual void ClosePinnedInspector (AzToolsFramework::EntityPropertyEditor *)
 
virtual AZStd::vector< AZStd::string > GetAgentTypes ()
 Return all available agent types defined in the Navigation xml file.
 
virtual void GoToSelectedOrHighlightedEntitiesInViewports ()
 Focus all viewports on the selected and highlighted entities.
 
virtual void GoToSelectedEntitiesInViewports ()
 Focus all viewports on the selected entities.
 
virtual bool CanGoToSelectedEntitiesInViewports ()
 Returns true if the selected entities can be moved to, and false if not.
 
virtual AZ::Vector3 GetWorldPositionAtViewportCenter ()
 Returns the world-space position under the center of the render viewport.
 
virtual void InstantiateSliceFromAssetId (const AZ::Data::AssetId &)
 
virtual void ClearRedoStack ()
 Clears current redo stack.
 

Static Public Attributes

static const AZ::EBusHandlerPolicy HandlerPolicy = AZ::EBusHandlerPolicy::Single
 

Detailed Description

Bus for general editor requests to be intercepted by the application (e.g. Sandbox).

Member Typedef Documentation

◆ WidgetCreationFunc

typedef AZStd::function<QWidget*(QWidget*)> AzToolsFramework::EditorRequests::WidgetCreationFunc

Registers a view pane (generally a QMainWindow-derived class) with the main editor. It's easier to use AzToolsFramework::RegisterViewPane, as it does not require a widget creation function to be supplied.

Parameters
name- display name for the pane. Will appear in the window header bar, as well as the context menu.
category- category under the Tools menu that will contain the option to open the pane.
viewOptions- structure defining various UI options for the pane.
widgetCreationFunc- function callback for constructing the pane.

Member Function Documentation

◆ CalculateAgentNavigationRadius()

virtual float AzToolsFramework::EditorRequests::CalculateAgentNavigationRadius ( const char *  )
inlinevirtual

Calculate the navigation 2D radius in units of an agent given its Navigation Type Name

Parameters
angentTypeNamethe name that identifies the agent navigation type
Returns
the 2D horizontal radius of the agent, -1 if not found

◆ CloseViewPane()

virtual void AzToolsFramework::EditorRequests::CloseViewPane ( const char *  )
inlinevirtual

Closes an Editor window by name. If the view pane was registered with the ViewPaneOptions.isDeletable set to true (the default), this will delete the view pane, if it was open. If the view pane was not registered with the ViewPaneOptions.isDeletable set to true, the view pane will be hidden instead.

◆ GetComponentEditorIcon()

virtual AZStd::string AzToolsFramework::EditorRequests::GetComponentEditorIcon ( const AZ::Uuid &  ,
const AZ::Component *   
)
inlinevirtual

Return path to icon for component. Path will be empty if component should have no icon.

◆ GetComponentIconPath()

virtual AZStd::string AzToolsFramework::EditorRequests::GetComponentIconPath ( const AZ::Uuid &  ,
AZ::Crc32  ,
const AZ::Component *   
)
inlinevirtual

Return the icon image path based on the component type and where it is used.

Parameters
componentTypecomponent type
componentIconAttribedit attribute describing where the icon is used, it could be one of Icon, Viewport and HidenIcon
Returns
the path of the icon image

◆ GetComponentTypeEditorIcon()

virtual AZStd::string AzToolsFramework::EditorRequests::GetComponentTypeEditorIcon ( const AZ::Uuid &  )
inlinevirtual

Return path to icon for component type. Path will be empty if component type should have no icon.

◆ GetDefaultAgentNavigationTypeName()

virtual const char * AzToolsFramework::EditorRequests::GetDefaultAgentNavigationTypeName ( )
inlinevirtual

Retrieve the default agent Navigation Type Name

Returns
the string identifying an agent navigation type

◆ GetViewPaneWidget()

virtual QWidget * AzToolsFramework::EditorRequests::GetViewPaneWidget ( const char *  )
inlinevirtual

Returns the widget contained/wrapped in a view pane.

Parameters
viewPaneName- the name of the pane which contains the widget to be retrieved. This must match the name used for registration.

◆ RegisterCustomViewPane()

virtual void AzToolsFramework::EditorRequests::RegisterCustomViewPane ( const char *  ,
const char *  ,
const ViewPaneOptions  
)
inlinevirtual

Similar to EditorRequests::RegisterViewPane, although instead of specifying a widget creation function, the user must connect to the ViewPaneCallbacks bus and respond to the CreateViewPaneWidget event that is called when the view pane needs to be constructed.

◆ UnregisterViewPane()

virtual void AzToolsFramework::EditorRequests::UnregisterViewPane ( const char *  )
inlinevirtual

Unregisters a view pane by name from the main editor.

Parameters
name- the name of the pane to be unregistered. This must match the name used for registration.

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