Open 3D Engine GraphCanvas 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.
GraphCanvas::SceneRequests Class Referenceabstract

#include <SceneBus.h>

Inherits AZ::EBusTraits.

Public Types

using BusIdType = AZ::EntityId
 

Public Member Functions

virtual void SetEditorId (const EditorId &)=0
 
virtual EditorId GetEditorId () const =0
 
virtual AZ::EntityId GetGrid () const =0
 Get the grid entity (for setting grid pitch)
 
virtual GraphicsEffectId CreatePulse (const AnimatedPulseConfiguration &pulseConfiguration)=0
 
virtual GraphicsEffectId CreatePulseAroundArea (const QRectF &area, int gridSteps, AnimatedPulseConfiguration &pulseConfiguration)=0
 
virtual GraphicsEffectId CreatePulseAroundSceneMember (const AZ::EntityId &memberId, int gridSteps, AnimatedPulseConfiguration pulseConfiguration)=0
 
virtual GraphicsEffectId CreateCircularPulse (const AZ::Vector2 &centerPoint, float initialRadius, float finalRadius, AnimatedPulseConfiguration pulseConfiguration)=0
 
virtual GraphicsEffectId CreateOccluder (const OccluderConfiguration &occluderConfiguration)=0
 
virtual GraphicsEffectId CreateGlow (const FixedGlowOutlineConfiguration &configuration)=0
 
virtual GraphicsEffectId CreateGlowOnSceneMember (const SceneMemberGlowOutlineConfiguration &configuration)=0
 
virtual GraphicsEffectId CreateParticle (const ParticleConfiguration &configuration)=0
 
virtual AZStd::vector< GraphicsEffectId > ExplodeSceneMember (const AZ::EntityId &memberId, float fillPercent)=0
 
virtual void CancelGraphicsEffect (const GraphicsEffectId &effectId)=0
 
virtual bool AddNode (const AZ::EntityId &, const AZ::Vector2 &, bool isPaste)=0
 
virtual void AddNodes (const AZStd::vector< AZ::EntityId > &)=0
 
virtual bool RemoveNode (const AZ::EntityId &)=0
 Remove a node from the scene.
 
virtual AZStd::vector< AZ::EntityId > GetNodes () const =0
 Get the entity IDs of the nodes known to the scene.
 
virtual AZStd::vector< AZ::EntityId > GetSelectedNodes () const =0
 Get the entity IDs of all selected nodes known to the scene.
 
virtual void DeleteNodeAndStitchConnections (const AZ::EntityId &node)=0
 
virtual AZ::EntityId CreateConnectionBetween (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint)=0
 
virtual bool AddConnection (const AZ::EntityId &)=0
 
virtual void AddConnections (const AZStd::vector< AZ::EntityId > &)=0
 
virtual bool RemoveConnection (const AZ::EntityId &)=0
 Remove a connection from the scene.
 
virtual AZStd::vector< AZ::EntityId > GetConnections () const =0
 Get the entity IDs of the connections known to the scene.
 
virtual AZStd::vector< AZ::EntityId > GetSelectedConnections () const =0
 Get the entity IDs of the selected connections known to the scene.
 
virtual bool IsEndpointConnected (const Endpoint &endpoint) const =0
 Returns whether or not the specified endpoint is connected to anything.
 
virtual AZStd::vector< AZ::EntityId > GetConnectionsForEndpoint (const Endpoint &endpoint) const =0
 Get the entity IDs of the connections where one endpoint of the connection is the supplied endpoint.
 
virtual AZStd::vector< EndpointGetConnectedEndpoints (const Endpoint &endpoint) const =0
 Get the IDs of the endpoint forming the other ends of all the connections this endpoint is apart of.
 
virtual bool CreateConnection (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint)=0
 Creates a connection between two endpoints. Will also create a connection with the underlying model.
 
virtual bool DisplayConnection (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint)=0
 Display a connection visually on the graph. Will not interact with the underlying model.
 
virtual bool Disconnect (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint)=0
 Destroys a connection using both endpoints to look up the connection.
 
virtual bool DisconnectById (const AZ::EntityId &connectionId)=0
 Destroys a connection using the supplied connection Id.
 
virtual bool FindConnection (AZ::Entity *&connectionEntity, const Endpoint &firstEndpoint, const Endpoint &otherEndpoint) const =0
 
virtual bool AddBookmarkAnchor (const AZ::EntityId &bookmarkAnchorId, const AZ::Vector2 &position)=0
 Adds a Bookmark Anchor.
 
virtual bool RemoveBookmarkAnchor (const AZ::EntityId &bookmarkAnchorId)=0
 Removes the specified Bookmark Anchor.
 
virtual bool Add (const AZ::EntityId &, bool)=0
 Add an entity of any valid type to the scene.
 
virtual bool Remove (const AZ::EntityId &)=0
 Remove an entity of any valid type from the scene.
 
virtual bool Show (const AZ::EntityId &graphMemeber)=0
 Shows a hidden entity in the scene.
 
virtual bool Hide (const AZ::EntityId &graphMember)=0
 Hides the specified graph member from the scene.
 
virtual bool IsHidden (const AZ::EntityId &graphMember) const =0
 Returns whether or not the specified member is hidden or not.
 
virtual bool Enable (const NodeId &nodeId)=0
 Enables the specified graph member in the graph.
 
virtual void EnableVisualState (const NodeId &nodeId)=0
 Enables the specified graph members visually.
 
virtual void EnableSelection ()=0
 Enables the selected elements in the graph.
 
virtual bool Disable (const NodeId &nodeId)=0
 Disables the specified graph member in the graph.
 
virtual void DisableVisualState (const NodeId &nodeId)=0
 Disables the specified graph members visually.
 
virtual void DisableSelection ()=0
 Disables the selected elements in the graph.
 
virtual void ProcessEnableDisableQueue ()=0
 Used during start-up to get the scene to process the queued enable/disable.
 
virtual void ClearSelection ()=0
 Clears the selection in the scene.
 
virtual void SetSelectedArea (const AZ::Vector2 &, const AZ::Vector2 &)=0
 
virtual void SelectAll ()=0
 Selects all items in the scene.
 
virtual void SelectConnectedNodes ()=0
 Selects all the items connected to the specified node.
 
virtual void SelectAllRelative (ConnectionType relativeDirection)=0
 Selects node by following the specified input direciton.
 
virtual bool HasSelectedItems () const =0
 Whether or not there are selected items in the scene.
 
virtual bool HasMultipleSelection () const =0
 Whether or not there are multiple selected items in the scene.
 
virtual bool HasCopiableSelection () const =0
 Returns whether or not there are items selected that should be copied.
 
virtual bool HasEntitiesAt (const AZ::Vector2 &) const =0
 Returns whether or not there are entities at the specified point.
 
virtual AZStd::vector< AZ::EntityId > GetSelectedItems () const =0
 Get the selected items in the scene.
 
virtual AZStd::vector< AZ::EntityId > GetEntitiesAt (const AZ::Vector2 &) const =0
 Get the entities known to the scene at a given position in scene space.
 
virtual AZStd::vector< AZ::EntityId > GetEntitiesInRect (const QRectF &, Qt::ItemSelectionMode) const =0
 Get the entities known to the scene in the given rectangle.
 
virtual AZStd::vector< EndpointGetEndpointsInRect (const QRectF &rect) const =0
 Get the endpoints known to the scene in the given rectangle.
 
virtual QGraphicsScene * AsQGraphicsScene ()=0
 Obtain the scene as a QGraphicsScene.
 
virtual void CopySelection () const =0
 Copies the selected nodes, connections and groups to the clipboard.
 
virtual void Copy (const AZStd::vector< AZ::EntityId > &) const =0
 Copies the specified entities to the clipboard.
 
virtual void SerializeEntities (const AZStd::unordered_set< AZ::EntityId > &itemIds, GraphSerialization &serializationTarget) const =0
 Serializes the specified entities to the given SceneSerializationHelper.
 
virtual void CutSelection ()=0
 Cuts the selected nodes, connections and groups to the clipboard.
 
virtual void Cut (const AZStd::vector< AZ::EntityId > &)=0
 Cuts the specified entities to the clipboard.
 
virtual void Paste ()=0
 Paste nodes, connections and groups within the GraphCanvas clipboard to the scene.
 
virtual void PasteAt (const QPointF &scenePos)=0
 
virtual void DeserializeEntities (const QPointF &scenePos, const GraphSerialization &serializationSource)=0
 
virtual void DuplicateSelection ()=0
 Duplicate the nodes, connections and groups currently selected to the scene.
 
virtual void DuplicateSelectionAt (const QPointF &scenePos)=0
 
virtual void Duplicate (const AZStd::vector< AZ::EntityId > &itemIds)=0
 
virtual void DuplicateAt (const AZStd::vector< AZ::EntityId > &itemIds, const QPointF &scenePos)=0
 
virtual void DeleteSelection ()=0
 Deletes the current selection from the scene.
 
virtual void Delete (const AZStd::unordered_set< AZ::EntityId > &)=0
 
virtual void ClearScene ()=0
 
virtual void SuppressNextContextMenu ()=0
 
virtual const AZStd::string & GetCopyMimeType () const =0
 Get the string that the scene use to set the mime type of the clipboard object.
 
virtual void SetMimeType (const char *mimeType)=0
 
virtual void RegisterView (const AZ::EntityId &viewId)=0
 
virtual void RemoveView (const AZ::EntityId &viewId)=0
 
virtual ViewId GetViewId () const =0
 
virtual void DispatchSceneDropEvent (const AZ::Vector2 &scenePos, const QMimeData *mimeData)=0
 Dispatches a Mime Drop Event to the this Scene.
 
virtual AZStd::any * GetUserData ()=0
 
virtual const AZStd::any * GetUserDataConst () const =0
 
virtual AZ::Entity * GetSceneEntity () const =0
 Retrieves the entity that the SceneRequests is addressed on.
 
virtual GraphDataGetGraphData ()=0
 
virtual const GraphDataGetGraphDataConst () const =0
 
virtual bool AddGraphData (const GraphData &)=0
 
virtual void RemoveGraphData (const GraphData &)=0
 
virtual void DeleteGraphData (const GraphData &)=0
 
virtual void SetDragSelectionType (DragSelectionType dragSelectionType)=0
 
virtual void SignalDragSelectStart ()=0
 
virtual void SignalDragSelectEnd ()=0
 
virtual bool IsDragSelecting () const =0
 
virtual void SignalConnectionDragBegin ()=0
 
virtual void SignalConnectionDragEnd ()=0
 
virtual bool IsDraggingConnection () const =0
 
virtual void SignalDesplice ()=0
 
virtual QRectF GetSelectedSceneBoundingArea () const =0
 
virtual QRectF GetSceneBoundingArea () const =0
 
virtual void SignalLoadStart ()=0
 
virtual void SignalLoadEnd ()=0
 
virtual bool IsLoading () const =0
 
virtual bool IsPasting () const =0
 
virtual void RemoveUnusedNodes ()=0
 
virtual void RemoveUnusedElements ()=0
 
virtual void HandleProposalDaisyChainWithGroup (const NodeId &startNode, SlotType slotType, ConnectionType connectionType, const QPoint &screenPoint, const QPointF &focusPoint, AZ::EntityId groupTarget)=0
 
virtual void HandleProposalDaisyChain (const NodeId &startNode, SlotType slotType, ConnectionType connectionType, const QPoint &screenPoint, const QPointF &focusPoint)
 
virtual void StartNudging (const AZStd::unordered_set< AZ::EntityId > &fixedNodes)=0
 
virtual void FinalizeNudging ()=0
 
virtual void CancelNudging ()=0
 
virtual AZ::EntityId FindTopmostGroupAtPoint (QPointF scenePoint)=0
 
virtual QPointF SignalGenericAddPositionUseBegin ()=0
 
virtual void SignalGenericAddPositionUseEnd ()=0
 

Static Public Attributes

static const AZ::EBusAddressPolicy AddressPolicy = AZ::EBusAddressPolicy::ById
 

Detailed Description

SceneRequests Requests that modify a scene.

Member Function Documentation

◆ AddConnection()

virtual bool GraphCanvas::SceneRequests::AddConnection ( const AZ::EntityId &  )
pure virtual

Add a connection to the scene. The connection must be connected to two slots and both slots must be in the same scene.

◆ AddConnections()

virtual void GraphCanvas::SceneRequests::AddConnections ( const AZStd::vector< AZ::EntityId > &  )
pure virtual

Add a list of connection to the scene. The connection must be connected to two slots and both slots must be in the same scene.

◆ AddGraphData()

virtual bool GraphCanvas::SceneRequests::AddGraphData ( const GraphData )
pure virtual

Uses the supplied scene data to add nodes, connections, to the scene.

Parameters
sceneDatastructure containing data to add to the scene(nodes, connections, etc...)

◆ AddNode()

virtual bool GraphCanvas::SceneRequests::AddNode ( const AZ::EntityId &  ,
const AZ::Vector2 &  ,
bool  isPaste 
)
pure virtual

Add a node to the scene. Nodes are owned by the scene and will follow the scene's entity life-cycle and be destroyed along with it. To avoid this, remove nodes before destroying the scene.

Additionally, the node should not already be in another scene.

Parameters

  1. The entity ID of the node to add.
  2. A 2D vector indicating the position in scene space the node should initially have.

◆ AddNodes()

virtual void GraphCanvas::SceneRequests::AddNodes ( const AZStd::vector< AZ::EntityId > &  )
pure virtual

Add a list of nodes to the scene. Nodes are owned by the scene and will follow the scene's entity life-cycle and be destroyed along with it. To avoid this, remove nodes before destroying the scene.

Additionally, the node should not already be in another scene.

Parameters

  1. The entity ID of the nodes to add.

◆ CreateConnectionBetween()

virtual AZ::EntityId GraphCanvas::SceneRequests::CreateConnectionBetween ( const Endpoint sourceEndpoint,
const Endpoint targetEndpoint 
)
pure virtual

Create a default connection (between two endpoints). The connection will link the specified endpoints and have a default visual. It will be styled.

Parameters

  1. The source endpoint.
  2. The target endpoint.

◆ Delete()

virtual void GraphCanvas::SceneRequests::Delete ( const AZStd::unordered_set< AZ::EntityId > &  )
pure virtual

Delete nodes from supplied set that exist within the scene

Parameters
itemIdsSet of ids to delete

◆ DeleteGraphData()

virtual void GraphCanvas::SceneRequests::DeleteGraphData ( const GraphData )
pure virtual

Deletes matching nodes, connections from the scene

Parameters
sceneDatastructure containing data to delete from the scene

◆ DeleteNodeAndStitchConnections()

virtual void GraphCanvas::SceneRequests::DeleteNodeAndStitchConnections ( const AZ::EntityId &  node)
pure virtual

Will remove a node from the graph, and attempt to stitch together as many connections were severed as is possible. Any ambiguous connections will be thrown out.

◆ DeserializeEntities()

virtual void GraphCanvas::SceneRequests::DeserializeEntities ( const QPointF &  scenePos,
const GraphSerialization serializationSource 
)
pure virtual

Paste scene serialization at the given position.

Parameters
scenePosthe position at which to deserialize the serialization.
serializationSourceis the data source from which data will be grabbed.

◆ Duplicate()

virtual void GraphCanvas::SceneRequests::Duplicate ( const AZStd::vector< AZ::EntityId > &  itemIds)
pure virtual

Duplicate the nodes, connections and groups specified by the input

Parameters
itemIdsthe id of the entity to be duplicated

◆ DuplicateAt()

virtual void GraphCanvas::SceneRequests::DuplicateAt ( const AZStd::vector< AZ::EntityId > &  itemIds,
const QPointF &  scenePos 
)
pure virtual

Duplicate the nodes, connections and groups to the position specified by the input

Parameters
itemIdsthe id of the entity to be duplicated
scenePosthe position to duplicate the selections to

◆ DuplicateSelectionAt()

virtual void GraphCanvas::SceneRequests::DuplicateSelectionAt ( const QPointF &  scenePos)
pure virtual

Duplicate the node, connections and group currently selected to the position given

Parameters
scenePosthe position to duplicate the selections to

◆ FindConnection()

virtual bool GraphCanvas::SceneRequests::FindConnection ( AZ::Entity *&  connectionEntity,
const Endpoint firstEndpoint,
const Endpoint otherEndpoint 
) const
pure virtual

Finds a connection using the specified endpoints A reference to the found connection is returned in the connectionEntity parameter

◆ GetGraphData()

virtual GraphData * GraphCanvas::SceneRequests::GetGraphData ( )
pure virtual

Returns a reference to the SceneData on the Scene, The SceneRequests handler must be retrieved to invoke this method

◆ GetUserData()

virtual AZStd::any * GraphCanvas::SceneRequests::GetUserData ( )
pure virtual

Retrieves the user data associated with the SceneData structure stored in the Scene component If the user data is serializable then it will get serialized when the SceneData structure is serialized A pointer is returned instead of a reference, as EBuses cannot references. If this bus is listening the return value is never null

◆ GetViewId()

virtual ViewId GraphCanvas::SceneRequests::GetViewId ( ) const
pure virtual

Retrieves the ViewId that this scene is registered with Returns registered ViewId if the Scene is registered with a view otherwise an invalid ViewId is returned

◆ PasteAt()

virtual void GraphCanvas::SceneRequests::PasteAt ( const QPointF &  scenePos)
pure virtual

Paste nodes, connections and groups within the GraphCanvas clipboard to the scene

Parameters
scenePosscene position where paste operation is to take place

◆ RemoveGraphData()

virtual void GraphCanvas::SceneRequests::RemoveGraphData ( const GraphData )
pure virtual

Removes matching nodes, connections from the scene Note: User data is not modified

Parameters
sceneDatastructure containing data to remove from the scene

◆ SetDragSelectionType()

virtual void GraphCanvas::SceneRequests::SetDragSelectionType ( DragSelectionType  dragSelectionType)
pure virtual

Controls how drag selection is handled. Default value is OnRelease.

◆ SetMimeType()

virtual void GraphCanvas::SceneRequests::SetMimeType ( const char *  mimeType)
pure virtual

Set the mime type for the scene. Allows the generic event system to distinguish between different instance of GraphCanvas.

◆ SetSelectedArea()

virtual void GraphCanvas::SceneRequests::SetSelectedArea ( const AZ::Vector2 &  ,
const AZ::Vector2 &   
)
pure virtual

Set the selected area in the scene (within the rectangle between two points). Items within this area are selected immediately and can be retrieved with GetSelectedItems

◆ SuppressNextContextMenu()

virtual void GraphCanvas::SceneRequests::SuppressNextContextMenu ( )
pure virtual

Stops the scene from allowing the next context menu's from being created.

Parameters
suppressedWhether or not context menu's should be allowed.

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