Debian Codegraph @

src/node.h

raw symbols SCIP
1 /*
2 Copyright (C) 2008, 2009 Andres Cabrera
3 [email protected]
4
5 This file is part of CsoundQt.
6
7 CsoundQt is free software; you can redistribute it
8 and/or modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or (at your option) any later version.
11
12 CsoundQt is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with Csound; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20 02111-1307 USA
21 */
22
23 #ifndef NODE_H
24 #define NODE_H
25
26 #include <QString>
27 #include <QVector>
28
29 class Node;
30
31 class Port {
32 public:
33 Port() {};
34
35 ~Port() {};
36 QString name;
37 QString argName; //parameter name
38 // Node *node;
39 bool optional; //optional parameter
40 bool connected;
41 };
42
43 class Node{
44 public:
45 Node();
46
47 ~Node();
48
49 void clear();
50 void setName(QString name);
51 QString getName();
52 void setComment(QString comment);
53 QString getComment();
54 void newInput(Port input);
55 void newOutput(Port output);
56 QVector<Port> getInputs();
57 QVector<Port> getOutputs();
58 void setInputs(QVector<Port> inputs);
59 void setOutputs(QVector<Port> outputs);
60 bool inputPortConnected(int portIndex);
61 void setInputPortConnected(bool connected, int portIndex);
62 bool outputPortConnected(int portIndex);
63 void setOutputPortConnected(bool connected, int portIndex);
64
65 protected:
66
67 QString m_name;
68 QString m_comment;
69 QVector<Port> m_inputs;
70 QVector<Port> m_outputs;
71 //TODO in inherited graphics node add shape attribute
72 };
73
74 #endif