Enzo
Loading...
Searching...
No Matches
enzo::nt::NetworkManager Class Reference

The central coordinator of the engine's node system. More...

#include <NetworkManager.h>

Inheritance diagram for enzo::nt::NetworkManager:

Public Member Functions

 NetworkManager (const NetworkManager &obj)=delete
 Deleted the copy constructor for singleton.
 
OpId addOperator (op::OpInfo opInfo)
 Creates a new node in the network.
 
std::optional< OpIdgetDisplayOp ()
 Returns the operator ID for the node with its display flag set. There can only be only be one operator displayed at a time. Return value is nullopt if no node is set to display.
 
bool isValidOp (nt::OpId opId)
 Returns whether the node exists in the network and is valid.
 
GeometryOperatorgetGeoOperator (nt::OpId opId)
 Returns a reference to the GeometryOperator with the given OpId.
 
void setDisplayOp (OpId opId)
 Sets given OpId to be displayed, releasing previous display Node.
 
void setSelectedNode (OpId opId, bool selected, bool add=false)
 Set the selection state for the given node.
 
const std::vector< enzo::nt::OpId > & getSelectedNodes ()
 Returns the OpIds for all selected nodes.
 

Static Public Member Functions

static NetworkManagergetInstance ()
 Returns a reference to the singleton instance.
 

Public Attributes

Signals
boost::signals2::signal< void(nt::OpId)> displayNodeChanged
 
boost::signals2::signal< void(enzo::geo::Geometry &geometry)> displayGeoChanged
 
boost::signals2::signal< void(std::vector< nt::OpId > selectedNodeIds)> selectedNodesChanged
 

Detailed Description

The central coordinator of the engine's node system.

The network manager is the central coordinator of the engine’s node system. It manages the lifecycle of operators, including their creation, storage, and validation, while also tracking dependencies between them. Acting as a singleton, it ensures that all parts of the engine work with a single consistent view of the network, providing global access. Beyond just storing operators, it also controls cooking and traversing dependency graphs, ensuring that updates flow correctly through the network when nodes change.

Todo
remove Qobject inheritance, this is no longer needed since switching to boost signals.

Member Function Documentation

◆ addOperator()

enzo::nt::OpId enzo::nt::NetworkManager::addOperator ( op::OpInfo opInfo)

Creates a new node in the network.

Parameters
OpInfoData designating the properties of the node.
Returns
The operator ID of the newly created node

◆ isValidOp()

bool enzo::nt::NetworkManager::isValidOp ( nt::OpId opId)

Returns whether the node exists in the network and is valid.

Parameters
opIdOperator ID of the node to check the validity of.

◆ setSelectedNode()

void enzo::nt::NetworkManager::setSelectedNode ( OpId opId,
bool selected,
bool add = false )

Set the selection state for the given node.

Parameters
opIdThe node to set the state on.
selectedThe selection state, true selects the node, false unselects it.
addBy default all other nodes are unselected, this parameter allows adding a selected node without deslecting any others.

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