About
maxon::nodes::NodesGraphModelInterface is an implementation of maxon::GraphModelInterface and presents the node system (NodeSystemInterface Manual) as a graph model.
- Note
 - If possible, one should work with the more generic maxon::GraphModelInterface, see GraphModelInterface Manual.
 
Access
The maxon::nodes::NodesGraphModelRef is obtained from the NodeMaterial:
- NodeMaterial::GetGraph(): Returns the node graph for the given node space ID.
 
See NodeMaterial Manual.
  
 
  
 
 
  if (nodeMaterial->HasSpace(nodeSpaceID) == false)
 
  const maxon::nodes::NodesGraphModelRef& graph = nodeMaterial->GetGraph(nodeSpaceID) 
iferr_return;
 
Definition: apibaseid.h:243
 
#define MAXON_SOURCE_LOCATION
Definition: memoryallocationbase.h:69
 
maxon::Id GetActiveNodeSpaceId()
 
#define iferr_return
Definition: resultbase.h:1511
 
  
Use
The node graph model gives access to the stored node system:
See NodeSystemInterface Manual.
  
 
  const maxon::nodes::NodesGraphModelRef& graph  = nodeMaterial->GetGraph(nodeSpaceID) 
iferr_return;
 
Definition: nodesystem.h:895
 
 A new nodes graph can be created with the class maxon::nodes::NodesGraphModelClass().
  
  
 
 
  const auto nodesGraphModelClass = maxon::nodes::NodesGraphModelClass();
  maxon::nodes::NodesGraphModelRef nodesGraphModel = nodesGraphModelClass.Create() 
iferr_return;
 
 
  nodesGraphModel.Init(sys, repository, filter, 
true) 
iferr_return;
 
static MAXON_METHOD const AssetRepositoryRef & GetBuiltinRepository()
 
Definition: nodesystem.h:2350
 
Result< NodeSystem > EndModification(Opt< ChangeList & > list={}, NodeSystem::FINALIZE_FLAGS finalize=NodeSystem::FINALIZE_FLAGS::CLEANUP)
 
@ NONE
Don't do any finalizations at all.
 
@ INCLUDE_INNER
Includes inner nodes in the view.
 
@ INCLUDE_HIDDEN
Includes hidden nodes in the view.
 
static const NO_VALUE_TYPE NO_VALUE
Definition: optional.h:17
 
 A view on a node graph is a new node graph that presents only a subset of the original node graph.
A node system can contain multiple children under the root node:
  
 
  
  const maxon::nodes::NodesGraphModelRef& nodeGraph = nodeMaterial->GetGraph(nodeSpaceID) 
iferr_return;
 
 
  if (nodeGraph.IsReadOnly())
 
  
 
  
 
  
  const maxon::Id nodeAssetId { 
"net.maxonexample.noderenderer.usernode" };
 
 
  
  
  
 
  
 
  
  const maxon::ChangeList& list = nodeGraph.GetChangeList();
Result< Bool > SetValue(const InternedId &attr, ForwardingDataPtr &&value, Bool checkAndInvalidate=true) const
Definition: graph.h:1717
 
Result< void > Commit(const DataDictionary &userData=GetPtrSizedZeroRef< DataDictionary >(), Bool validate=true)
 
static MAXON_METHOD Result< NodeTemplate > LoadTemplate(const AssetRepositoryRef &repo, const Id &assetId)
 
 Nodes can be organized in group nodes:
Nodes are based on assets from the asset repository:
A maxon::nodes::NodeSystemManagerInterface manages a node system and its views: