Open 3D Engine EMotionFX 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.
EMStudio::NodeGraph Class Reference

Inherits QObject.

Public Member Functions

 NodeGraph (const QModelIndex &modelIndex, NodeGraphWidget *graphWidget=nullptr)
 
const QModelIndex & GetModelIndex () const
 
AZStd::vector< GraphNode * > GetSelectedGraphNodes () const
 
AZStd::vector< EMotionFX::AnimGraphNode * > GetSelectedAnimGraphNodes () const
 
AZStd::vector< NodeConnection * > GetSelectedNodeConnections () const
 
bool IsInReferencedGraph () const
 
const QTransform & GetTransform () const
 
float GetScale () const
 
void SetScale (float scale)
 
const QPoint & GetScrollOffset () const
 
void SetScrollOffset (const QPoint &offset)
 
void SetScalePivot (const QPoint &pivot)
 
float GetLowestScale () const
 
bool GetIsCreatingConnection () const
 
bool GetIsRelinkingConnection () const
 
void SetCreateConnectionIsValid (bool isValid)
 
bool GetIsCreateConnectionValid () const
 
void SetTargetPort (NodePort *port)
 
NodePortGetTargetPort ()
 
float GetDashOffset () const
 
QColor GetErrorBlinkColor () const
 
bool GetIsRepositioningTransitionHead () const
 
bool GetIsRepositioningTransitionTail () const
 
NodeConnectionGetRepositionedTransitionHead () const
 
NodeConnectionGetRepositionedTransitionTail () const
 
void StartReplaceTransitionHead (NodeConnection *connection, QPoint startOffset, QPoint endOffset, GraphNode *sourceNode, GraphNode *targetNode)
 
void StartReplaceTransitionTail (NodeConnection *connection, QPoint startOffset, QPoint endOffset, GraphNode *sourceNode, GraphNode *targetNode)
 
void GetReplaceTransitionInfo (NodeConnection **outConnection, QPoint *outOldStartOffset, QPoint *outOldEndOffset, GraphNode **outOldSourceNode, GraphNode **outOldTargetNode)
 
void StopReplaceTransitionHead ()
 
void StopReplaceTransitionTail ()
 
void SetReplaceTransitionValid (bool isValid)
 
bool GetReplaceTransitionValid () const
 
void RenderReplaceTransition (QPainter &painter)
 
GraphNodeGetCreateConnectionNode () const
 
NodeConnectionGetRelinkConnection ()
 
AZ::u16 GetCreateConnectionPortNr () const
 
bool GetCreateConnectionIsInputPort () const
 
const QPoint & GetCreateConnectionStartOffset () const
 
const QPoint & GetCreateConnectionEndOffset () const
 
void SetCreateConnectionEndOffset (const QPoint &offset)
 
bool CheckIfHasConnection (GraphNode *sourceNode, AZ::u16 outputPortNr, GraphNode *targetNode, AZ::u16 inputPortNr) const
 
NodeConnectionFindInputConnection (GraphNode *targetNode, AZ::u16 targetPortNr) const
 
NodeConnectionFindConnection (const QPoint &mousePos)
 
void SelectAllNodes ()
 
void UnselectAllNodes ()
 
size_t CalcNumSelectedNodes () const
 
GraphNodeFindNode (const QPoint &globalPoint)
 
void StartCreateConnection (AZ::u16 portNr, bool isInputPort, GraphNode *portNode, NodePort *port, const QPoint &startOffset)
 
void StartRelinkConnection (NodeConnection *connection, AZ::u16 portNr, GraphNode *node)
 
void StopCreateConnection ()
 
void StopRelinkConnection ()
 
void UpdateHighlightConnectionFlags (const QPoint &mousePos)
 
virtual void RenderBackground (QPainter &painter, int32 width, int32 height)
 
virtual void Render (const QItemSelectionModel &selectionModel, QPainter &painter, int32 width, int32 height, const QPoint &mousePos, float timePassedInSeconds)
 
virtual void RenderCreateConnection (QPainter &painter)
 
void UpdateNodesAndConnections (int32 width, int32 height, const QPoint &mousePos)
 
void SelectNodesInRect (const QRect &rect, bool overwriteCurSelection=true, bool toggleMode=false)
 
void SelectConnectionCloseTo (const QPoint &point, bool overwriteCurSelection=true, bool toggle=false)
 
QRect CalcRectFromSelection (bool includeConnections=true) const
 
QRect CalcRectFromGraph () const
 
NodePortFindPort (int32 x, int32 y, GraphNode **outNode, AZ::u16 *outPortNr, bool *outIsInputPort, bool includeInputPorts=true)
 
EMotionFX::AnimGraphNodeGroupFindNodeGroup (const QPoint &globalPoint) const
 
bool CheckInsideNodeGroupTitleRect (const EMotionFX::AnimGraphNodeGroup *nodeGroup, const QPoint &globalPoint) const
 
void EnableNameEditForNodeGroup (EMotionFX::AnimGraphNodeGroup *nodeGroup)
 
void DisableNameEditForNodeGroup ()
 
void RemoveNodeGroup (EMotionFX::AnimGraphNodeGroup *nodeGroup)
 
void SetEntryNode (GraphNode *entryNode)
 
void FitGraphOnScreen (int32 width, int32 height, const QPoint &mousePos, bool animate=true)
 
void ScrollTo (const QPointF &point)
 
void ZoomIn ()
 
void ZoomOut ()
 
void ZoomTo (float scale)
 
void ZoomOnRect (const QRect &rect, int32 width, int32 height, bool animate=true)
 
void StopAnimatedZoom ()
 
void StopAnimatedScroll ()
 
void DrawOverlay (QPainter &painter)
 
bool GetUseAnimation () const
 
void SetUseAnimation (bool useAnim)
 
void OnRowsAboutToBeRemoved (const QModelIndexList &modelIndexes)
 
void OnRowsInserted (const QModelIndexList &modelIndexes)
 
void OnDataChanged (const QModelIndex &modelIndex, const QVector< int > &roles)
 
void Reinit ()
 
GraphNodeFindGraphNode (const QModelIndex &modelIndex)
 
GraphNodeFindGraphNode (const EMotionFX::AnimGraphNode *node)
 
const GraphNodeFindGraphNode (const EMotionFX::AnimGraphNode *node) const
 
StateConnectionFindStateConnection (const QModelIndex &modelIndex)
 
NodeConnectionFindNodeConnection (const QModelIndex &modelIndex)
 
void UpdateVisualGraphFlags ()
 
void RecursiveSetOpacity (EMotionFX::AnimGraphNode *startNode, float opacity)
 
AnimGraphModelGetAnimGraphModel () const
 

Static Public Member Functions

static void RenderEntryPoint (QPainter &painter, GraphNode *node)
 
static void DrawSmoothedLineFast (QPainter &painter, int32 x1, int32 y1, int32 x2, int32 y2, int32 stepSize)
 
static float DistanceToLine (float x1, float y1, float x2, float y2, float px, float py)
 
static bool LinesIntersect (double Ax, double Ay, double Bx, double By, double Cx, double Cy, double Dx, double Dy, double *X, double *Y)
 
static bool LineIntersectsRect (const QRect &b, float x1, float y1, float x2, float y2, double *outX=nullptr, double *outY=nullptr)
 
static bool CheckIfIsRelinkConnectionValid (NodeConnection *connection, GraphNode *newTargetNode, AZ::u16 newTargetPortNr, bool isTargetInput)
 

Protected Types

using GraphNodeByModelIndex = AZStd::unordered_map< QPersistentModelIndex, AZStd::unique_ptr< GraphNode >, QPersistentModelIndexHash >
 

Protected Slots

void UpdateAnimatedScrollOffset ()
 
void UpdateAnimatedScale ()
 

Protected Member Functions

void RenderNodeGroups (QPainter &painter)
 
void RenderTitlebar (QPainter &painter, const QString &text, int32 width)
 
void RenderTitlebar (QPainter &painter, int32 width)
 
void SyncTransition (StateConnection *visualStateConnection, const EMotionFX::AnimGraphStateTransition *transition, GraphNode *targetGraphNode)
 
QRect ComputeNodeGroupRect (const EMotionFX::AnimGraphNodeGroup *nodeGroup) const
 

Protected Attributes

NodeGraphWidgetm_graphWidget
 
QPersistentModelIndex m_currentModelIndex
 
QPersistentModelIndex m_parentReferenceNode
 
GraphNodeByModelIndex m_graphNodeByModelIndex
 
GraphNodem_entryNode
 
QTransform m_transform
 
float m_scale
 
int32 m_minStepSize
 
int32 m_maxStepSize
 
QPoint m_scrollOffset
 
QPoint m_scalePivot
 
QPointF m_targetScrollOffset
 
QPointF m_startScrollOffset
 
QTimer m_scrollTimer
 
AZ::Debug::Timer m_scrollPreciseTimer
 
float m_targetScale
 
float m_startScale
 
QTimer m_scaleTimer
 
AZ::Debug::Timer m_scalePreciseTimer
 
QPoint m_conStartOffset
 
QPoint m_conEndOffset
 
AZ::u16 m_conPortNr
 
bool m_conIsInputPort
 
QModelIndex m_conNodeIndex
 
NodeConnectionm_relinkConnection
 
NodePortm_conPort
 
NodePortm_targetPort
 
bool m_conIsValid
 
float m_dashOffset
 
float m_errorBlinkOffset
 
bool m_useAnimation
 
NodeConnectionm_replaceTransitionHead
 
NodeConnectionm_replaceTransitionTail
 
QPoint m_replaceTransitionStartOffset
 
QPoint m_replaceTransitionEndOffset
 
GraphNodem_replaceTransitionSourceNode
 
GraphNodem_replaceTransitionTargetNode
 
bool m_replaceTransitionValid
 
QPen m_subgridPen
 
QPen m_gridPen
 
QFont m_font
 
QString m_qtTempString
 
QTextOption m_textOptions
 
QFontMetrics * m_fontMetrics
 
AZStd::string m_tempStringA
 
AZStd::string m_tempStringB
 
AZStd::string m_tempStringC
 
AZStd::string m_mcoreTempString
 
QFont m_groupFont
 
QScopedPointer< QFontMetrics > m_groupFontMetrics
 
QScopedPointer< ZoomableLineEditm_nodeGroupNameLineEdit
 
EMotionFX::AnimGraphNodeGroupm_currentNameEditNodeGroup = nullptr
 

Static Protected Attributes

static float sLowestScale
 

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