File indexing completed on 2024-06-09 13:46:34

0001 //
0002 // C++ Interface: inputflownode
0003 //
0004 // Description:
0005 //
0006 //
0007 // Copyright: See COPYING file that comes with this distribution
0008 //
0009 //
0010 #ifndef INPUTFLOWNODE_H
0011 #define INPUTFLOWNODE_H
0012 
0013 #include <fpnode.h>
0014 
0015 /**
0016  a FlowNode which serves as an input for a flowpart
0017 */
0018 class InputFlowNode : public FPNode
0019 {
0020 public:
0021     InputFlowNode(ICNDocument *icnDocument, int dir, const QPoint &pos, QString *id = nullptr);
0022 
0023     ~InputFlowNode() override;
0024 
0025     /**
0026      * Returns a pointer to the FlowPart attached to this node if this node isInput, or
0027      * to the other end of the connector (if one exists) if it isOutput()
0028      */
0029     FlowPart *outputFlowPart() const override;
0030 
0031     /**
0032      * Returns a list of FlowParts attached to the node - either a single-item list containing
0033      * the FlowPart attached to this node if isOutput, or a list of FlowParts connected to the
0034      * input (?) connectors
0035      */
0036     FlowPartList inputFlowParts() const override;
0037 
0038     /**
0039      * Returns true if the node can accept input connections. This will depend
0040      * on the node type and number of input / output connections.
0041      */
0042     bool acceptInput() const override;
0043     /**
0044      * Returns true if the node can accept output connections. This will depend
0045      * on the node type and number of input / output connections.
0046      */
0047     bool acceptOutput() const override;
0048 
0049     /**
0050      * Registers an input connector (i.e. this is the start node) as connected
0051      * to this node.
0052      */
0053     void addOutputConnector(Connector *const connector) override;
0054 
0055 public slots:
0056 
0057     /**
0058      * Draw shape. Note that this has to remain public.
0059      */
0060     void drawShape(QPainter &p) override;
0061 };
0062 
0063 #endif