10 #include <AtomsGraph/Globals.h>
11 #include <AtomsGraph/Nodes/NodeIds.h>
12 #include <AtomsGraph/Node.h>
13 #include <AtomsGraph/Ports.h>
14 #include <AtomsUtils/AtomsMath.h>
20 ATOMSGRAPH_EXPORT
void registerIfNodes();
27 static unsigned int staticTypeId();
31 static std::string staticTypeStr();
43 virtual bool compute(
const ComputeData* computeData);
46 PortTemplate<bool> *m_inB;
48 PortTemplate<T> *m_in1;
49 PortTemplate<T> *m_in2;
51 PortTemplate<T> *m_out;
61 for (
auto portIt = inputPortCBegin(); portIt != inputPortCEnd(); ++portIt)
63 if ((*portIt)->numConnections() > 0)
76 m_out->set(m_in1->getRef());
80 m_out->set(m_in2->getRef());
94 m_inB =
new PortTemplate<bool>(
"if");
95 m_in1 =
new PortTemplate<T>(
"in1");
96 m_in2 =
new PortTemplate<T>(
"in2");
97 m_out =
new PortTemplate<T>(
"out");
102 addOutputPort(m_out);
105 ATOMS_IMPLEMENT_NODE(IfNode<bool>, IfBool, IF_BOOL_NODE_ID)
106 ATOMS_IMPLEMENT_NODE(IfNode<long>, IfLong, IF_LONG_NODE_ID)
107 ATOMS_IMPLEMENT_NODE(IfNode<double>, IfDouble, IF_DOUBLE_NODE_ID)
108 ATOMS_IMPLEMENT_NODE(IfNode<std::string>, IfString, IF_STRING_NODE_ID)
109 ATOMS_IMPLEMENT_NODE(IfNode<AtomsMath::Matrix>, IfMatrix, IF_MATRIX_NODE_ID)
110 ATOMS_IMPLEMENT_NODE(IfNode<AtomsMath::Vector3>, IfVector, IF_VECTOR_NODE_ID)
111 ATOMS_IMPLEMENT_NODE(IfNode<AtomsMath::Quaternion>, IfQuaternion, IF_QUATERNION_NODE_ID)
112 ATOMS_IMPLEMENT_NODE(IfNode<AtomsUtils::Curve>, IfCurve, IF_CURVE_NODE_ID)
unsigned int typeId() const
Type id.
Definition: IfNodes.h:29
virtual bool compute(const ComputeData *computeData)
Compute function.
Definition: IfNodes.h:72
virtual Node * clone()
clone object
Definition: IfNodes.h:55
virtual std::string typeStr() const
Type string.
Definition: IfNodes.h:33
void setName(const std::string &name)
Sets the node name.
Definition: Node.impl.h:56
T * getInputPort(const std::string &name)
Gets input port.
Definition: Node.impl.h:84
BasePort class.
Definition: Port.h:26
virtual void copyValue(Port *other)
Copy the data from another port.
AtomsGraph namespace.
Definition: PosePort.h:15