Open 3D Engine GraphCanvas Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
GraphCanvas::ConnectionComponent Class Reference

Inherits AZ::Component, ConnectionRequestBus::Handler, SceneMemberRequestBus::Handler, AZ::TickBus::Handler, ViewNotificationBus::Handler, NodeNotificationBus::Handler, and GraphCanvas::SceneNotificationBus::Handler.

Inherited by GraphCanvas::DataConnectionComponent.

Classes

struct  ConnectionCandidate
 
class  ConnectionEndpointAnimator
 

Public Member Functions

 AZ_COMPONENT (ConnectionComponent, "{14BB1535-3B30-4B1C-8324-D864963FBC76}", AZ::Component)
 
 ConnectionComponent (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint, bool createModelConnection=true)
 
void Activate () override
 
void Deactivate () override
 
void OnSlotRemovedFromNode (const AZ::EntityId &slotId) override
 
AZ::EntityId GetSourceSlotId () const override
 
AZ::EntityId GetSourceNodeId () const override
 
Endpoint GetSourceEndpoint () const override
 
QPointF GetSourcePosition () const override
 
void StartSourceMove () override
 
void SnapSourceDisplayTo (const Endpoint &sourceEndpoint) override
 
void AnimateSourceDisplayTo (const Endpoint &sourceEndpoint, float connectionTime) override
 
AZ::EntityId GetTargetSlotId () const override
 
AZ::EntityId GetTargetNodeId () const override
 
Endpoint GetTargetEndpoint () const override
 
QPointF GetTargetPosition () const override
 
void StartTargetMove () override
 
void SnapTargetDisplayTo (const Endpoint &targetEndpoint) override
 
void AnimateTargetDisplayTo (const Endpoint &targetEndpoint, float connectionTime) override
 
bool ContainsEndpoint (const Endpoint &endpoint) const override
 
void ChainProposalCreation (const QPointF &scenePos, const QPoint &screenPos, AZ::EntityId groupTarget) override
 
void SetScene (const AZ::EntityId &sceneId) override
 
void ClearScene (const AZ::EntityId &oldSceneId) override
 
void SignalMemberSetupComplete () override
 
AZ::EntityId GetScene () const override
 
AZStd::string GetTooltip () const override
 
void SetTooltip (const AZStd::string &tooltip) override
 
AZStd::any * GetUserData () override
 
void OnTick (float deltaTime, AZ::ScriptTimePoint timePoint) override
 
void OnEscape () override
 
void OnFocusLost () override
 
void OnNodeIsBeingEdited (bool isBeingEditeed) override
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
static AZ::Entity * CreateBaseConnectionEntity (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint, bool createModelConnection, const AZStd::string &selectorClass)
 
static AZ::Entity * CreateGeneralConnection (const Endpoint &sourceEndpoint, const Endpoint &targetEndpoint, bool createModelConnection, const AZStd::string &substyle="")
 
static void GetProvidedServices (AZ::ComponentDescriptor::DependencyArrayType &provided)
 
static void GetIncompatibleServices (AZ::ComponentDescriptor::DependencyArrayType &incompatible)
 
static void GetDependentServices (AZ::ComponentDescriptor::DependencyArrayType &dependent)
 
static void GetRequiredServices ([[maybe_unused]] AZ::ComponentDescriptor::DependencyArrayType &required)
 

Protected Types

enum class  DragContext {
  Unknown , TryConnection , MoveSource , MoveTarget ,
  Connected
}
 
enum class  ConnectionMoveResult { DeleteConnection , ConnectionMove , NodeCreation }
 

Protected Member Functions

 ConnectionComponent (const ConnectionComponent &)=delete
 
const ConnectionComponentoperator= (const ConnectionComponent &)=delete
 
void SetGroupTarget (AZ::EntityId groupTarget)
 
void FinalizeMove ()
 
virtual void OnConnectionMoveStart ()
 
virtual bool OnConnectionMoveCancelled ()
 
virtual ConnectionMoveResult OnConnectionMoveComplete (const QPointF &scenePos, const QPoint &screenPos, AZ::EntityId groupTarget)
 
virtual bool AllowNodeCreation () const
 
void CleanupToast ()
 
void StartMove ()
 
void StopMove ()
 
bool UpdateProposal (Endpoint &activePoint, const Endpoint &proposedEndpoint, AZStd::function< void(const AZ::EntityId &, const AZ::EntityId &)> endpointChangedFunctor)
 
ConnectionCandidate FindConnectionCandidateAt (const QPointF &scenePos) const
 
void UpdateMovePosition (const QPointF &scenePos)
 
void FinalizeMove (const QPointF &scenePos, const QPoint &screenPos, bool chainAddition)
 
void DisplayConnectionToolTip (const QPointF &scenePos, const Endpoint &connectionTarget)
 

Protected Attributes

ConnectionValidationTooltip m_validationResult
 
Endpoint m_endpointTooltip
 
AzToolsFramework::ToastId m_toastId
 
GraphId m_graphId
 The Id of the graph this connection belongs to.
 
Endpoint m_sourceEndpoint
 The source endpoint that this connection is from.
 
ConnectionEndpointAnimator m_sourceAnimator
 
Endpoint m_targetEndpoint
 The target endpoint that this connection is to.
 
ConnectionEndpointAnimator m_targetAnimator
 
QPointF m_mousePoint
 Information needed to handle the dragging aspect of the connections.
 
DragContext m_dragContext
 
Endpoint m_previousEndPoint
 
AZStd::string m_tooltip
 
ConnectionEventFilterm_eventFilter = nullptr
 
AZStd::any m_userData
 Store custom data for this connection.
 
StateSetter< RootGraphicsItemDisplayState > m_nodeDisplayStateStateSetter
 
StateSetter< RootGraphicsItemDisplayState > m_connectionStateStateSetter
 
AZ::EntityId m_groupTarget
 
StateSetter< RootGraphicsItemDisplayState > m_forcedGroupDisplayStateStateSetter
 
StateSetter< AZStd::string > m_forcedLayerStateSetter
 

Friends

class ConnectionEventFilter
 

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