MCPcopy Create free account
hub / github.com/BobbyAnguelov/Esoterica / FindNode

Function FindNode

Code/EngineTools/NodeGraph/NodeGraph_BaseGraph.h:468–504  ·  view source on GitHub ↗

Find a specific node in the graph

Source from the content-addressed store, hash-verified

466 CreateNodeInternal( pNode, position );
467 return pNode;
468 }
469
470 inline BaseNode* CreateNode( TypeSystem::TypeInfo const* pTypeInfo, Float2 const& position = Float2::Zero )
471 {
472 EE_ASSERT( CanCreateNode( pTypeInfo ) );
473 BaseNode* pNode = Cast<BaseNode>( pTypeInfo->CreateType() );
474 CreateNodeInternal( pNode, position );
475 return pNode;
476 }
477
478 // Override this for additional control of what nodes can be deleted
479 virtual bool CanDestroyNode( BaseNode const* pNode ) const { return true; }
480
481 // Helpers
482 //-------------------------------------------------------------------------
483
484 // Called whenever we change the view to this graph
485 void OnShowGraph();
486
487 // Find a specific node in the graph
488 inline BaseNode* FindNode( UUID const& nodeID, bool checkRecursively = false ) const
489 {
490 for ( TTypeInstance<BaseNode> const& nodeInstance : m_nodes )
491 {
492 EE_ASSERT( nodeInstance.IsSet() );
493
494 BaseNode* pNode = const_cast<BaseNode*>( nodeInstance.Get() );
495
496 if ( pNode->GetID() == nodeID )
497 {
498 return pNode;
499 }
500
501 if ( checkRecursively )
502 {
503 if ( pNode->HasChildGraph() )
504 {
505 auto pFoundNode = pNode->GetChildGraph()->FindNode( nodeID, checkRecursively );
506 if ( pFoundNode != nullptr )
507 {

Callers 6

GetNodeFunction · 0.85
PostDeserializeMethod · 0.85
GetMostSignificantNodeFunction · 0.85
SetDefaultEntryStateMethod · 0.85
PostDeserializeMethod · 0.85

Calls 3

IsSetMethod · 0.45
GetMethod · 0.45
GetIDMethod · 0.45

Tested by

no test coverage detected