PeriDyno 1.0.0
Loading...
Searching...
No Matches
NodePort.cpp
Go to the documentation of this file.
1#include "NodePort.h"
2#include "Node.h"
3
4namespace dyno
5{
6
7 NodePort::NodePort(std::string name, std::string description, Node* parent /*= nullptr*/)
8 : m_name(name)
9 , m_description(description)
11 , m_parent(parent)
12 {
13 parent->addNodePort(this);
14 }
15
20
22 {
23 m_portType = portType;
24 }
25
27 {
28 m_nodes.clear();
29 }
30
31 void NodePort::attach(std::shared_ptr<FCallBackFunc> func)
32 {
33 mCallbackFunc.push_back(func);
34 }
35
37 {
38 for (auto func : mCallbackFunc)
39 {
40 func->update();
41 }
42 }
43
44 void disconnect(Node* node, NodePort* port)
45 {
46 node->disconnect(port);
47 }
48
49}
50
bool disconnect(NodePort *nPort)
Definition Node.cpp:488
bool addNodePort(NodePort *port)
Definition Node.cpp:580
Input ports for Node.
Definition NodePort.h:38
NodePortType getPortType()
Definition NodePort.cpp:16
std::string m_name
Definition NodePort.h:76
Node * m_parent
Definition NodePort.h:74
std::vector< Node * > m_nodes
Definition NodePort.h:70
friend class Node
Definition NodePort.h:82
std::vector< std::shared_ptr< FCallBackFunc > > mCallbackFunc
Definition NodePort.h:80
NodePort(std::string name, std::string description, Node *parent=nullptr)
Definition NodePort.cpp:7
virtual void clear()
Definition NodePort.cpp:26
void setPortType(NodePortType portType)
Definition NodePort.cpp:21
std::string m_description
Definition NodePort.h:77
virtual void notify()
Definition NodePort.cpp:36
void attach(std::shared_ptr< FCallBackFunc > func)
Definition NodePort.cpp:31
NodePortType m_portType
Definition NodePort.h:78
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
void disconnect(Node *node, NodePort *port)
Definition NodePort.cpp:44
NodePortType
Definition NodePort.h:27
@ Unknown
Definition NodePort.h:30