|
Enzo
|
The unique runtime representation of a node. More...
#include <Node.h>
Public Member Functions | |
| Node (enzo::nt::NodeId nodeId, const nt::NodeType &nodeType, const Path &path) | |
| Constructs a new node. | |
| Node (const Node &)=delete | |
| Deleted copy constructor to avoid accidental copies. | |
| Node & | operator= (const Node &)=delete |
| Deleted copy assignment operator to avoid accidental copies. | |
| void | cook (nt::CookContext &context) |
| Builds the node's implementation and runs its cook, filling the output packets. | |
| std::shared_ptr< const enzo::NodePacket > | getOutputPacket (unsigned int outputIndex) const |
| Returns the current output geometry. | |
| void | setOutputPacket (unsigned int outputIndex, enzo::NodePacket packet) |
| Stores finished geometry against one of the node's outputs. | |
| bool | outputRequested (unsigned int outputIndex) const |
| Returns whether anything downstream is asking for one of the node's outputs. | |
| std::vector< std::weak_ptr< prm::NodeParameter > > | getParameters () |
| Returns all parameters belonging to this node. | |
| std::weak_ptr< prm::NodeParameter > | getParameter (std::string_view parameterName) |
| Returns a parameter with the given name belonging to this node. | |
| bool | isParameterEnabled (std::string_view parmName) |
| Whether the named parameter's disable condition leaves it enabled. | |
| bool | isParameterHidden (std::string_view parmName) |
| Whether the named parameter's hide condition currently hides it. | |
| std::optional< std::string > | getReferencedValue (const std::string &text) |
| Returns the value text written as prm(name) reads from that parameter, or the text itself when it names no parameter. | |
| const std::vector< prm::Template > & | getTemplates () const |
| Returns the template tree declared by this node's type. | |
| std::string | getName () const |
| Returns the runtime name uniquely identifying this node among its siblings (eg. "grid1") | |
| const Path & | getPath () const |
| Returns the full path locating this node within the network. | |
| void | setPath (const Path &path) |
| Sets the full path locating this node within the network. | |
| const nt::NodeType & | getType () const |
| Returns the static type definition this node was created from. | |
| void | dirtyNode (bool dirtyDescendents=true) |
| Marks the outputed geometry as outdated and notifies the network. | |
| bool | isDirty () |
| Returns true if the node is dirty and false if the node is clean (does not need cooking). | |
| bool | takesInput () const |
| Returns whether the node takes any input at all. | |
| unsigned int | getMaxOutputs () const |
| Returns the number of available outputs the node provides. | |
| Vector2 | getPosition () const |
| Returns the node's position in the network graph. | |
| void | setPosition (Vector2 pos) |
| Sets the node's position in the network graph. | |
Public Attributes | |
| boost::signals2::signal< void(nt::NodeId nodeId, bool dirtyDescendents)> | nodeDirtied |
| A signal emitted when the node is dirtied. This will usually notify the NetworkManager. | |
| boost::signals2::signal< void(const std::string &parmName)> | parameterChanged |
| A signal emitted when one parameter's value changes, carrying its name. | |
The unique runtime representation of a node.
| enzo::nt::Node::Node | ( | enzo::nt::NodeId | nodeId, |
| const nt::NodeType & | nodeType, | ||
| const Path & | path ) |
Constructs a new node.
| nodeId | the node id assigned to this node. For most situations this should be set by the nt::NetworkManager |
| nodeType | The data class informing the node what its properties are that set it apart from other nodes. This is what makes a grid node different to a transform node. |
| path | The full path locating the node, whose leaf is the node name. The nt::NetworkManager picks a path that is free within its parent. |
| void enzo::nt::Node::cook | ( | nt::CookContext & | context | ) |
Builds the node's implementation and runs its cook, filling the output packets.
| void enzo::nt::Node::dirtyNode | ( | bool | dirtyDescendents = true | ) |
Marks the outputed geometry as outdated and notifies the network.
| dirtyDescendents | Sets whether all descendents (nodes connected directly or indirectly to the output of this node) are also dirtied. This is usually what you want. |
| std::string enzo::nt::Node::getName | ( | ) | const |
Returns the runtime name uniquely identifying this node among its siblings (eg. "grid1")
The name is the leaf of the node's path, not stored separately. Unlike the type name it is per node and is intended to be user assignable. Only nodes sharing a parent have to differ, so the same name can appear once in every scope.
| std::shared_ptr< const NodePacket > enzo::nt::Node::getOutputPacket | ( | unsigned int | outputIndex | ) | const |
Returns the current output geometry.
Does not trigger a cook so if the geometry may be outdated if not cooked first.
| std::weak_ptr< prm::NodeParameter > enzo::nt::Node::getParameter | ( | std::string_view | parameterName | ) |
Returns a parameter with the given name belonging to this node.
| std::optional< std::string > enzo::nt::Node::getReferencedValue | ( | const std::string & | text | ) |
Returns the value text written as prm(name) reads from that parameter, or the text itself when it names no parameter.
| const std::vector< prm::Template > & enzo::nt::Node::getTemplates | ( | ) | const |
Returns the template tree declared by this node's type.
| const nt::NodeType & enzo::nt::Node::getType | ( | ) | const |
| bool enzo::nt::Node::isParameterEnabled | ( | std::string_view | parmName | ) |
Whether the named parameter's disable condition leaves it enabled.
| bool enzo::nt::Node::isParameterHidden | ( | std::string_view | parmName | ) |
Whether the named parameter's hide condition currently hides it.
| bool enzo::nt::Node::outputRequested | ( | unsigned int | outputIndex | ) | const |
Returns whether anything downstream is asking for one of the node's outputs.