Open 3D Engine GraphModel 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.
GraphModel::ModuleNode Class Reference

#include <ModuleNode.h>

Inherits GraphModel::Node.

Public Member Functions

 AZ_CLASS_ALLOCATOR (ModuleNode, AZ::SystemAllocator)
 
 AZ_RTTI (ModuleNode, "{C7D57EFE-462D-48A0-B46F-6E927D504BA5}", Node)
 
 ModuleNode (GraphPtr ownerGraph, AZ::Uuid moduleGraphFileId, AZStd::string_view moduleGraphFileName)
 
const char * GetTitle () const override
 Returns the name that will be displayed as the title of the Node in the UI.
 
void PostLoadSetup (GraphPtr ownerGraph, NodeId id) override
 
virtual void PostLoadSetup (GraphPtr graph, NodeId id)
 
virtual void PostLoadSetup ()
 
- Public Member Functions inherited from GraphModel::Node
 AZ_CLASS_ALLOCATOR (Node, AZ::SystemAllocator)
 
 AZ_RTTI (Node, "{274B4495-FDBF-45A9-9BAD-9E90269F2B73}", GraphElement)
 
 Node (GraphPtr graph)
 
virtual void PostLoadSetup (GraphPtr graph, NodeId id)
 
virtual void PostLoadSetup ()
 
virtual const char * GetTitle () const =0
 Returns the name that will be displayed as the title of the Node in the UI.
 
virtual const char * GetSubTitle () const
 Returns the name that will be displayed as the sub-title of the Node in the UI.
 
virtual NodeType GetNodeType () const
 
NodeId GetId () const
 Return the unique ID for this node in the containing graph.
 
uint32_t GetMaxInputDepth () const
 Return the greatest distance, number of connected nodes, between this node and other root nodes.
 
uint32_t GetMaxOutputDepth () const
 Return the greatest distance, number of connected nodes, between this node and other leaf nodes.
 
bool HasSlots () const
 Return true if this node contains any slots.
 
bool HasInputSlots () const
 Return true if this node contains any input slots.
 
bool HasOutputSlots () const
 Return true if this node contains any output slots.
 
bool HasConnections () const
 Returns true if the graph contains any connections referencing this node.
 
bool HasInputConnections () const
 Returns true if the graph has any connections to input slots on this node.
 
bool HasOutputConnections () const
 Returns true if the graph has any connections to output slots on this node.
 
bool HasInputConnectionFromNode (ConstNodePtr node) const
 Returns true if any of the input slots on this node have direct or indirect connections to output slots on the specified node.
 
bool HasOutputConnectionToNode (ConstNodePtr node) const
 Returns true if any of the output slots on this node have direct or indirect connections to input slots on the specified node.
 
bool Contains (ConstSlotPtr slot) const
 Returns true if this node contains the specified slot.
 
const SlotDefinitionList & GetSlotDefinitions () const
 Returns SlotDefinitions for all available Slots.
 
const SlotMap & GetSlots ()
 
ConstSlotMap GetSlots () const
 
SlotPtr GetSlot (const SlotId &slotId)
 Returns the slot with the given slotId, or nullptr if it doesn't exist.
 
ConstSlotPtr GetSlot (const SlotId &slotId) const
 
SlotPtr GetSlot (const SlotName &name)
 
ConstSlotPtr GetSlot (const SlotName &name) const
 
const ExtendableSlotSet & GetExtendableSlots (const SlotName &name)
 Returns an ordered set of the extendable slots for a given SlotName, or an empty set if there are none.
 
int GetExtendableSlotCount (const SlotName &name) const
 
void DeleteSlot (SlotPtr slot)
 
virtual bool CanDeleteSlot (ConstSlotPtr slot) const
 
virtual SlotPtr AddExtendedSlot (const SlotName &slotName)
 
void ClearCachedData ()
 Clear any data that was cached for this node.
 
- Public Member Functions inherited from GraphModel::GraphElement
 AZ_CLASS_ALLOCATOR (GraphElement, AZ::SystemAllocator)
 
 AZ_RTTI (GraphElement, "{FD83C7CA-556B-49F1-BACE-6E9C7A4D6347}")
 
 GraphElement (GraphPtr graph)
 
GraphPtr GetGraph () const
 Returns the Graph that owns this GraphElement.
 
GraphContextPtr GetGraphContext () const
 Returns the GraphContext for this GraphElement.
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 
- Static Public Member Functions inherited from GraphModel::Node
static void Reflect (AZ::ReflectContext *context)
 
- Static Public Member Functions inherited from GraphModel::GraphElement
static void Reflect (AZ::ReflectContext *context)
 

Protected Member Functions

void LoadModuleGraph (ModuleGraphManagerPtr moduleGraphManager)
 Gets the module graph that defines this ModuleNode.
 
void RegisterSlots () override
 Registers input and output SlotDescriptions based on the contents of the module graph.
 
- Protected Member Functions inherited from GraphModel::Node
virtual bool CanExtendSlot (SlotDefinitionPtr slotDefinition) const
 
void RegisterSlot (SlotDefinitionPtr slotDefinition)
 
virtual void RegisterSlots ()
 
void CreateSlotData ()
 

Protected Attributes

ConstGraphPtr m_moduleGraph
 The module graph that defines the inputs, outputs, and behavior of this node.
 
AZStd::string m_nodeTitle
 Node title indicates the name of the module file.
 
AZ::Uuid m_moduleGraphFileId
 Unique identifier of the source file that contains the module graph.
 
- Protected Attributes inherited from GraphModel::GraphElement
AZStd::weak_ptr< Graphm_graph
 

Additional Inherited Members

- Public Types inherited from GraphModel::Node
using SlotDefinitionList = AZStd::vector< SlotDefinitionPtr >
 
using SlotMap = AZStd::map< SlotId, SlotPtr >
 
using ConstSlotMap = AZStd::map< SlotId, const SlotPtr >
 
using ExtendableSlotSet = AZStd::set< SlotPtr, SortSlotsBySubId >
 
using ExtendableSlotMap = AZStd::map< SlotName, ExtendableSlotSet >
 
- Static Public Attributes inherited from GraphModel::Node
static const int INVALID_NODE_ID = 0
 

Detailed Description

Encapsulates an entire node graph as a node to be used in another graph. The graph that defines this node is called a Module Graph, which has GraphInputNodes and/or GraphOutputNodes to define inputs and outputs for the graph. These input/output nodes become input/output Slots in the ModuleNode.

Constructor & Destructor Documentation

◆ ModuleNode()

GraphModel::ModuleNode::ModuleNode ( GraphPtr  ownerGraph,
AZ::Uuid  moduleGraphFileId,
AZStd::string_view  moduleGraphFileName 
)

Constructor

Parameters
ownerGraphThe graph that owns this node
sourceFileIdThe unique id for the module node graph source file, which is the module graph that defines this ModuleNode.
sourceFilePathThe path to the module node graph source file. This will be used for node naming and debug output.

Member Function Documentation

◆ GetTitle()

const char * GraphModel::ModuleNode::GetTitle ( ) const
overridevirtual

Returns the name that will be displayed as the title of the Node in the UI.

Implements GraphModel::Node.

◆ PostLoadSetup() [1/3]

virtual void GraphModel::Node::PostLoadSetup ( )
virtual

An alternative to the above PostLoadSetup when the nodeId isn't already known (e.g. a deserialized node that has been copy/pasted)

Reimplemented from GraphModel::Node.

◆ PostLoadSetup() [2/3]

virtual void GraphModel::Node::PostLoadSetup ( GraphPtr  graph,
NodeId  id 
)
virtual

Initializion after the Node has been serialized in. This must be called whenever the default constructor is used. Sets the m_graph pointer and caches pointers to other GraphElements. It also ensures the loaded Slot data aligns with the defined SlotDefinitions.

Reimplemented from GraphModel::Node.

◆ PostLoadSetup() [3/3]

void GraphModel::ModuleNode::PostLoadSetup ( GraphPtr  graph,
NodeId  id 
)
overridevirtual

Initializion after the Node has been serialized in. This must be called whenever the default constructor is used. Sets the m_graph pointer and caches pointers to other GraphElements. It also ensures the loaded Slot data aligns with the defined SlotDefinitions.

Reimplemented from GraphModel::Node.

◆ RegisterSlots()

void GraphModel::ModuleNode::RegisterSlots ( )
overrideprotectedvirtual

Registers input and output SlotDescriptions based on the contents of the module graph.

Reimplemented from GraphModel::Node.


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