10 #include <AtomsGraph/Globals.h>
11 #include <AtomsGraph/Node.h>
12 #include <AtomsGraph/Port.h>
13 #include <AtomsGraph/PortTemplate.h>
15 #include <unordered_map>
55 bool renameNode(
const std::string& name,
const std::string& newName);
77 bool connectAttr(
const std::string& sourceNode,
const std::string& sourceAttribute,
78 const std::string& destinationNode,
const std::string& destinationAttribute);
87 bool disconnectAttr(
const std::string& sourceNode,
const std::string& sourceAttribute,
88 const std::string& destinationNode,
const std::string& destinationAttribute);
101 T* getNode(
const std::string& name);
121 const std::string& nodeName,
123 bool multithread=
false,
124 bool useNetworkCache=
false
167 std::map<std::string, Node*> m_nodes;
170 std::map<std::string, std::vector<Node*>> m_networkCache;
177 std::map<std::string, std::pair<bool, Node*>> m_nodesCached;
181 #include "NetworkManager.impl.h"
Network manager class.
Definition: NetworkManager.h:27
void cleanNetwork()
Deletes all the nodes.
std::string getUniqueName(const std::string &name)
Generates an unique node name.
NetworkManager & operator=(const NetworkManager &other)
Assign operator.
std::vector< std::string > getNodeNames()
Gets all node names of the graph.
void setAllNodeDirty()
Set all nodes as dirty.
void reset()
Reset the network without deleting the node cached.
Node * createNode(const std::string &typeName, const std::string &name)
Creates a node inside this graph.
void clearNodeCache()
Clear the node cache removing all the nodes that are not in use.
bool disconnectAttr(const std::string &sourceNode, const std::string &sourceAttribute, const std::string &destinationNode, const std::string &destinationAttribute)
Disconnects two nodes.
bool connectAttr(const std::string &sourceNode, const std::string &sourceAttribute, const std::string &destinationNode, const std::string &destinationAttribute)
Connects two nodes.
void clearNodeNetworkCaches()
Clear all caches.
void deleteNode(const std::string &name)
Deletes a node.
bool renameNode(const std::string &name, const std::string &newName)
Renames a node inside this graph.
NetworkManager(const NetworkManager &other)
Copy constructor.
void clearNodeNetworkCache(const std::string &nodeName)
Clear a cache.
Node * getNode(const std::string &name)
Gets the node with the given name.
NetworkManager()
Constructor.
NetworkManager clone() const
Clones the graph.
void computeNode(const std::string &nodeName, const AtomsGraph::ComputeData *computeData, bool multithread=false, bool useNetworkCache=false)
Evaluates a node and the incoming graph.
std::vector< Node * > getAllNodes()
Gets all nodes of the graph.
~NetworkManager()
Destructor.
void cacheNodeNetwork(const std::string &nodeName)
Cache nodes order.
void addNode(Node *node, const std::string &name)
Adds a node to the graph.
Node * getNodeByType(const unsigned int id)
Gets the node with the given name.
AtomsGraph namespace.
Definition: PosePort.h:15