├── .gitattributes ├── LICENSE ├── NodeSystem ├── Derived │ ├── addnode.cpp │ ├── addnode.h │ ├── dividenode.cpp │ ├── dividenode.h │ ├── math │ │ ├── acoshnode.cpp │ │ ├── acoshnode.h │ │ ├── acosnode.cpp │ │ ├── acosnode.h │ │ ├── asinhnode.cpp │ │ ├── asinhnode.h │ │ ├── asinnode.cpp │ │ ├── asinnode.h │ │ ├── atan2node.cpp │ │ ├── atan2node.h │ │ ├── atanhnode.cpp │ │ ├── atanhnode.h │ │ ├── atannode.cpp │ │ ├── atannode.h │ │ ├── ceilnode.cpp │ │ ├── ceilnode.h │ │ ├── coshnode.cpp │ │ ├── coshnode.h │ │ ├── cosnode.cpp │ │ ├── cosnode.h │ │ ├── degreesnode.cpp │ │ ├── degreesnode.h │ │ ├── desktop.ini │ │ ├── econstnode.cpp │ │ ├── econstnode.h │ │ ├── erfcnode.cpp │ │ ├── erfcnode.h │ │ ├── erfnode.cpp │ │ ├── erfnode.h │ │ ├── expnode.cpp │ │ ├── expnode.h │ │ ├── fabsnode.cpp │ │ ├── fabsnode.h │ │ ├── factorialnode.cpp │ │ ├── factorialnode.h │ │ ├── floornode.cpp │ │ ├── floornode.h │ │ ├── frexpnode.cpp │ │ ├── frexpnode.h │ │ ├── gammanode.cpp │ │ ├── gammanode.h │ │ ├── hypotnode.cpp │ │ ├── hypotnode.h │ │ ├── lgammanode.cpp │ │ ├── lgammanode.h │ │ ├── lognode.cpp │ │ ├── lognode.h │ │ ├── pinode.cpp │ │ ├── pinode.h │ │ ├── pownode.cpp │ │ ├── pownode.h │ │ ├── radiansnode.cpp │ │ ├── radiansnode.h │ │ ├── sinhnode.cpp │ │ ├── sinhnode.h │ │ ├── sinnode.cpp │ │ ├── sinnode.h │ │ ├── sqrtnode.cpp │ │ ├── sqrtnode.h │ │ ├── tanhnode.cpp │ │ ├── tanhnode.h │ │ ├── tannode.cpp │ │ └── tannode.h │ ├── modulonode.cpp │ ├── modulonode.h │ ├── multiplynode.cpp │ ├── multiplynode.h │ ├── printnode.cpp │ ├── printnode.h │ ├── subtract.cpp │ ├── subtract.h │ ├── var1d.cpp │ └── var1d.h ├── blackboard.cpp ├── blackboard.h ├── checkboxcore.h ├── comboboxcore.h ├── cursor.cpp ├── cursor.h ├── labelcore.h ├── nodecore.cpp ├── nodecore.h ├── nodevaluefinder.cpp ├── nodevaluefinder.h ├── numberboxcore.h ├── port.cpp ├── port.h ├── resultparser.cpp ├── resultparser.h └── textboxcore.h ├── Operator.pro ├── README.md ├── _config.yml ├── main.cpp ├── main.qml ├── qml.qrc └── qtquickcontrols2.conf /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Shivendra Pratap Singh 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /NodeSystem/Derived/addnode.cpp: -------------------------------------------------------------------------------- 1 | #include "addnode.h" 2 | 3 | AddNode::AddNode() 4 | { 5 | this->setTitle("Add"); 6 | this->setHeight(180); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(7,138,123)); 9 | this->setPanelGradColor(QColor(45,53,187)); 10 | 11 | this->functionName="add"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,80); 16 | p1.PortColor=this->panelColor(); 17 | 18 | Port p2; 19 | p2.Parent=this; 20 | p2.Position=QPoint(20,130); 21 | p2.PortColor=this->panelColor(); 22 | 23 | 24 | this->inputPort.push_back(p1); 25 | this->inputPort.push_back(p2); 26 | 27 | Port p3; 28 | 29 | p3.Parent=this; 30 | p3.Position=QPoint(125,105); 31 | p3.PortColor=this->panelGradColor(); 32 | p3.Type=PortType::OutPut; 33 | 34 | this->outputPort.push_back(p3); 35 | 36 | Label l1; 37 | l1.Text="A"; 38 | l1.Pos=QPoint(40,90); 39 | 40 | Label l2; 41 | l2.Text="B"; 42 | l2.Pos=QPoint(40,140); 43 | 44 | this->labelList.push_back(l1); 45 | this->labelList.push_back(l2); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /NodeSystem/Derived/addnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ADDNODE_H 2 | #define ADDNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class AddNode : public NodeCore 8 | { 9 | public: 10 | AddNode(); 11 | }; 12 | 13 | #endif // ADDNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/dividenode.cpp: -------------------------------------------------------------------------------- 1 | #include "dividenode.h" 2 | 3 | Divide::Divide() 4 | { 5 | this->setTitle("Divide"); 6 | this->setHeight(180); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(142,68,173)); 9 | this->setPanelGradColor(QColor(86, 101, 115)); 10 | 11 | this->functionName="divide"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,80); 16 | p1.PortColor=this->panelColor(); 17 | 18 | Port p2; 19 | p2.Parent=this; 20 | p2.Position=QPoint(20,130); 21 | p2.PortColor=this->panelColor(); 22 | 23 | 24 | this->inputPort.push_back(p1); 25 | this->inputPort.push_back(p2); 26 | 27 | Port p3; 28 | 29 | p3.Parent=this; 30 | p3.Position=QPoint(125,105); 31 | p3.PortColor=this->panelGradColor(); 32 | p3.Type=PortType::OutPut; 33 | 34 | this->outputPort.push_back(p3); 35 | 36 | Label l1; 37 | l1.Text="A"; 38 | l1.Pos=QPoint(40,90); 39 | 40 | Label l2; 41 | l2.Text="B"; 42 | l2.Pos=QPoint(40,140); 43 | 44 | this->labelList.push_back(l1); 45 | this->labelList.push_back(l2); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /NodeSystem/Derived/dividenode.h: -------------------------------------------------------------------------------- 1 | #ifndef DIVIDENODE_H 2 | #define DIVIDENODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class Divide : public NodeCore 8 | { 9 | public: 10 | Divide(); 11 | }; 12 | 13 | #endif // DIVIDENODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/acoshnode.cpp: -------------------------------------------------------------------------------- 1 | #include "acoshnode.h" 2 | 3 | ACosHNode::ACosHNode() 4 | { 5 | this->setTitle("ACosh"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(195,20,50)); 9 | this->setPanelGradColor(QColor(36,11,54)); 10 | 11 | this->functionName="math.acosh"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/acoshnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ACOSHNODE_H 2 | #define ACOSHNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class ACosHNode : public NodeCore 7 | { 8 | public: 9 | ACosHNode(); 10 | }; 11 | 12 | #endif // ACOSHNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/acosnode.cpp: -------------------------------------------------------------------------------- 1 | #include "acosnode.h" 2 | 3 | ACosNode::ACosNode() 4 | { 5 | this->setTitle("ACos"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(229,93,135)); 9 | this->setPanelGradColor(QColor(95,195,228)); 10 | 11 | this->functionName="math.acos"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/acosnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ACOSNODE_H 2 | #define ACOSNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class ACosNode : public NodeCore 8 | { 9 | public: 10 | ACosNode(); 11 | }; 12 | 13 | #endif // ACOSNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/asinhnode.cpp: -------------------------------------------------------------------------------- 1 | #include "asinhnode.h" 2 | 3 | ASinHNode::ASinHNode() 4 | { 5 | this->setTitle("ASinh"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(195,20,50)); 9 | this->setPanelGradColor(QColor(36,11,54)); 10 | 11 | this->functionName="math.asinh"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/asinhnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ASINHNODE_H 2 | #define ASINHNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class ASinHNode : public NodeCore 7 | { 8 | public: 9 | ASinHNode(); 10 | }; 11 | 12 | #endif // ASINHNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/asinnode.cpp: -------------------------------------------------------------------------------- 1 | #include "asinnode.h" 2 | 3 | asinnode::asinnode() 4 | { 5 | this->setTitle("ASin"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(229,93,135)); 9 | this->setPanelGradColor(QColor(95,195,228)); 10 | 11 | this->functionName="math.asin"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/asinnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ASINNODE_H 2 | #define ASINNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class asinnode:public NodeCore 7 | { 8 | public: 9 | asinnode(); 10 | }; 11 | 12 | #endif // ASINNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/atan2node.cpp: -------------------------------------------------------------------------------- 1 | #include "atan2node.h" 2 | 3 | ATan2Node::ATan2Node() 4 | { 5 | this->setTitle("ATan2"); 6 | this->setHeight(180); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(121,159,12)); 9 | this->setPanelGradColor(QColor(255,224,0)); 10 | 11 | this->functionName="math.atan2"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,80); 16 | p1.PortColor=this->panelColor(); 17 | 18 | Port p2; 19 | p2.Parent=this; 20 | p2.Position=QPoint(20,130); 21 | p2.PortColor=this->panelColor(); 22 | 23 | 24 | this->inputPort.push_back(p1); 25 | this->inputPort.push_back(p2); 26 | 27 | Port p3; 28 | 29 | p3.Parent=this; 30 | p3.Position=QPoint(125,105); 31 | p3.PortColor=this->panelGradColor(); 32 | p3.Type=PortType::OutPut; 33 | 34 | this->outputPort.push_back(p3); 35 | 36 | Label l1; 37 | l1.Text="Y"; 38 | l1.Pos=QPoint(40,90); 39 | 40 | Label l2; 41 | l2.Text="X"; 42 | l2.Pos=QPoint(40,140); 43 | 44 | this->labelList.push_back(l1); 45 | this->labelList.push_back(l2); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/atan2node.h: -------------------------------------------------------------------------------- 1 | #ifndef ATAN2NODE_H 2 | #define ATAN2NODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class ATan2Node : public NodeCore 7 | { 8 | public: 9 | ATan2Node(); 10 | }; 11 | 12 | #endif // ATAN2NODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/atanhnode.cpp: -------------------------------------------------------------------------------- 1 | #include "atanhnode.h" 2 | 3 | ATanHNode::ATanHNode() 4 | { 5 | this->setTitle("ATanh"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(195,20,50)); 9 | this->setPanelGradColor(QColor(36,11,54)); 10 | 11 | this->functionName="math.atanh"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/atanhnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ATANHNODE_H 2 | #define ATANHNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class ATanHNode : public NodeCore 7 | { 8 | public: 9 | ATanHNode(); 10 | }; 11 | 12 | #endif // ATANHNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/atannode.cpp: -------------------------------------------------------------------------------- 1 | #include "atannode.h" 2 | 3 | ATan::ATan() 4 | { 5 | this->setTitle("ATan"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(229,93,135)); 9 | this->setPanelGradColor(QColor(95,195,228)); 10 | 11 | this->functionName="math.atan"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/atannode.h: -------------------------------------------------------------------------------- 1 | #ifndef ATAN_H 2 | #define ATAN_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class ATan : public NodeCore 7 | { 8 | public: 9 | ATan(); 10 | }; 11 | 12 | #endif // ATAN_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/ceilnode.cpp: -------------------------------------------------------------------------------- 1 | #include "ceilnode.h" 2 | 3 | CeilNode::CeilNode() 4 | { 5 | this->setTitle("Ceil"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(Qt::magenta)); 9 | this->setPanelGradColor(QColor(0,131,176)); 10 | 11 | this->functionName="math.ceil"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/ceilnode.h: -------------------------------------------------------------------------------- 1 | #ifndef CEILNODE_H 2 | #define CEILNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class CeilNode : public NodeCore 7 | { 8 | public: 9 | CeilNode(); 10 | }; 11 | 12 | #endif // CEILNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/coshnode.cpp: -------------------------------------------------------------------------------- 1 | #include "coshnode.h" 2 | 3 | CosHNode::CosHNode() 4 | { 5 | this->setTitle("Cosh"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(195,20,50)); 9 | this->setPanelGradColor(QColor(36,11,54)); 10 | 11 | this->functionName="math.cosh"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/coshnode.h: -------------------------------------------------------------------------------- 1 | #ifndef COSHNODE_H 2 | #define COSHNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class CosHNode : public NodeCore 7 | { 8 | public: 9 | CosHNode(); 10 | }; 11 | 12 | #endif // COSHNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/cosnode.cpp: -------------------------------------------------------------------------------- 1 | #include "cosnode.h" 2 | 3 | cosnode::cosnode() 4 | { 5 | this->setTitle("Cos"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(221,38,118)); 9 | this->setPanelGradColor(QColor(255,81,47)); 10 | 11 | this->functionName="math.cos"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/cosnode.h: -------------------------------------------------------------------------------- 1 | #ifndef COSNODE_H 2 | #define COSNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class cosnode:public NodeCore 7 | { 8 | public: 9 | cosnode(); 10 | }; 11 | 12 | #endif // COSNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/degreesnode.cpp: -------------------------------------------------------------------------------- 1 | #include "degreesnode.h" 2 | 3 | DegreesNode::DegreesNode() 4 | { 5 | this->setTitle("Degrees"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(253,200,48)); 9 | this->setPanelGradColor(QColor(243,115,53)); 10 | 11 | this->functionName="math.degrees"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/degreesnode.h: -------------------------------------------------------------------------------- 1 | #ifndef DEGREESNODE_H 2 | #define DEGREESNODE_H 3 | #include"NodeSystem/nodecore.h" 4 | 5 | 6 | class DegreesNode : public NodeCore 7 | { 8 | public: 9 | DegreesNode(); 10 | }; 11 | 12 | #endif // DEGREESNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/desktop.ini: -------------------------------------------------------------------------------- 1 | [LocalizedFileNames] 2 | var1d.h=@var1d.h,0 3 | acoshnode.cpp=@acoshnode.cpp,0 4 | acoshnode.h=@acoshnode.h,0 5 | acosnode.cpp=@acosnode.cpp,0 6 | acosnode.h=@acosnode.h,0 7 | addnode.cpp=@addnode.cpp,0 8 | addnode.h=@addnode.h,0 9 | asinhnode.cpp=@asinhnode.cpp,0 10 | asinhnode.h=@asinhnode.h,0 11 | asinnode.cpp=@asinnode.cpp,0 12 | asinnode.h=@asinnode.h,0 13 | atan2node.cpp=@atan2node.cpp,0 14 | atan2node.h=@atan2node.h,0 15 | atanhnode.cpp=@atanhnode.cpp,0 16 | atanhnode.h=@atanhnode.h,0 17 | atannode.cpp=@atannode.cpp,0 18 | atannode.h=@atannode.h,0 19 | blackboard.cpp=@blackboard.cpp,0 20 | blackboard.h=@blackboard.h,0 21 | ceilnode.cpp=@ceilnode.cpp,0 22 | ceilnode.h=@ceilnode.h,0 23 | checkboxcore.h=@checkboxcore.h,0 24 | coshnode.cpp=@coshnode.cpp,0 25 | coshnode.h=@coshnode.h,0 26 | cosnode.cpp=@cosnode.cpp,0 27 | cosnode.h=@cosnode.h,0 28 | cursor.cpp=@cursor.cpp,0 29 | cursor.h=@cursor.h,0 30 | degreesnode.cpp=@degreesnode.cpp,0 31 | degreesnode.h=@degreesnode.h,0 32 | dividenode.cpp=@dividenode.cpp,0 33 | dividenode.h=@dividenode.h,0 34 | econstnode.cpp=@econstnode.cpp,0 35 | econstnode.h=@econstnode.h,0 36 | erfcnode.cpp=@erfcnode.cpp,0 37 | erfcnode.h=@erfcnode.h,0 38 | erfnode.cpp=@erfnode.cpp,0 39 | erfnode.h=@erfnode.h,0 40 | expnode.cpp=@expnode.cpp,0 41 | expnode.h=@expnode.h,0 42 | fabsnode.cpp=@fabsnode.cpp,0 43 | fabsnode.h=@fabsnode.h,0 44 | factorialnode.cpp=@factorialnode.cpp,0 45 | factorialnode.h=@factorialnode.h,0 46 | floornode.cpp=@floornode.cpp,0 47 | floornode.h=@floornode.h,0 48 | frexpnode.cpp=@frexpnode.cpp,0 49 | frexpnode.h=@frexpnode.h,0 50 | gammanode.cpp=@gammanode.cpp,0 51 | gammanode.h=@gammanode.h,0 52 | hypotnode.cpp=@hypotnode.cpp,0 53 | hypotnode.h=@hypotnode.h,0 54 | labelcore.h=@labelcore.h,0 55 | lgammanode.cpp=@lgammanode.cpp,0 56 | lgammanode.h=@lgammanode.h,0 57 | lognode.cpp=@lognode.cpp,0 58 | lognode.h=@lognode.h,0 59 | modulonode.cpp=@modulonode.cpp,0 60 | modulonode.h=@modulonode.h,0 61 | multiplynode.cpp=@multiplynode.cpp,0 62 | multiplynode.h=@multiplynode.h,0 63 | nodecore.cpp=@nodecore.cpp,0 64 | nodecore.h=@nodecore.h,0 65 | nodevaluefinder.cpp=@nodevaluefinder.cpp,0 66 | nodevaluefinder.h=@nodevaluefinder.h,0 67 | numberboxcore.h=@numberboxcore.h,0 68 | pinode.cpp=@pinode.cpp,0 69 | pinode.h=@pinode.h,0 70 | port.cpp=@port.cpp,0 71 | port.h=@port.h,0 72 | pownode.cpp=@pownode.cpp,0 73 | pownode.h=@pownode.h,0 74 | printnode.cpp=@printnode.cpp,0 75 | printnode.h=@printnode.h,0 76 | radiansnode.cpp=@radiansnode.cpp,0 77 | radiansnode.h=@radiansnode.h,0 78 | resultparser.cpp=@resultparser.cpp,0 79 | resultparser.h=@resultparser.h,0 80 | sinhnode.cpp=@sinhnode.cpp,0 81 | sinhnode.h=@sinhnode.h,0 82 | sinnode.cpp=@sinnode.cpp,0 83 | sinnode.h=@sinnode.h,0 84 | sqrtnode.cpp=@sqrtnode.cpp,0 85 | sqrtnode.h=@sqrtnode.h,0 86 | subtract.cpp=@subtract.cpp,0 87 | subtract.h=@subtract.h,0 88 | tanhnode.cpp=@tanhnode.cpp,0 89 | tanhnode.h=@tanhnode.h,0 90 | tannode.cpp=@tannode.cpp,0 91 | tannode.h=@tannode.h,0 92 | textboxcore.h=@textboxcore.h,0 93 | var1d.cpp=@var1d.cpp,0 94 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/econstnode.cpp: -------------------------------------------------------------------------------- 1 | #include "econstnode.h" 2 | 3 | EconstNode::EconstNode() 4 | { 5 | this->setTitle("E"); 6 | this->setHeight(120); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(Qt::green)); 9 | this->setPanelGradColor(QColor(Qt::red)); 10 | 11 | this->functionName="math.e"; 12 | 13 | Port p; 14 | p.Parent=this; 15 | p.Position=QPoint(125,75); 16 | p.PortColor=panelGradColor(); 17 | p.Type=PortType::OutPut; 18 | 19 | Label n; 20 | n.Text="const"; 21 | n.Pos=QPoint(10,82); 22 | 23 | this->labelList.push_back(n); 24 | 25 | this->outputPort.push_back(p); 26 | } 27 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/econstnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ECONSTNODE_H 2 | #define ECONSTNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class EconstNode : public NodeCore 8 | { 9 | public: 10 | EconstNode(); 11 | }; 12 | 13 | #endif // ECONSTNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/erfcnode.cpp: -------------------------------------------------------------------------------- 1 | #include "erfcnode.h" 2 | 3 | ErfcNode::ErfcNode() 4 | { 5 | this->setTitle("Erfc"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(0,180,219)); 9 | this->setPanelGradColor(QColor(0,131,176)); 10 | 11 | this->functionName="math.erfc"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/erfcnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ERFCNODE_H 2 | #define ERFCNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class ErfcNode : public NodeCore 8 | { 9 | public: 10 | ErfcNode(); 11 | }; 12 | 13 | #endif // ERFCNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/erfnode.cpp: -------------------------------------------------------------------------------- 1 | #include "erfnode.h" 2 | 3 | 4 | ErfNode::ErfNode() 5 | { 6 | this->setTitle("Erf"); 7 | this->setHeight(120); 8 | this->setWidth(140); 9 | this->setPanelColor(QColor(0,180,219)); 10 | this->setPanelGradColor(QColor(0,131,176)); 11 | 12 | this->functionName="math.erf"; 13 | 14 | Port p1; 15 | p1.Parent=this; 16 | p1.Position=QPoint(20,75); 17 | p1.PortColor=panelColor(); 18 | 19 | 20 | 21 | this->inputPort.push_back(p1); 22 | 23 | Port p3; 24 | 25 | p3.Parent=this; 26 | p3.Position=QPoint(125,75); 27 | p3.PortColor=panelGradColor(); 28 | p3.Type=PortType::OutPut; 29 | 30 | this->outputPort.push_back(p3); 31 | 32 | Label l1; 33 | l1.Text="Value"; 34 | l1.Pos=QPoint(40,85); 35 | 36 | 37 | 38 | this->labelList.push_back(l1); 39 | } 40 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/erfnode.h: -------------------------------------------------------------------------------- 1 | #ifndef ERFNODE_H 2 | #define ERFNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | 8 | class ErfNode : public NodeCore 9 | { 10 | public: 11 | ErfNode(); 12 | }; 13 | 14 | #endif // ERFNODE_H 15 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/expnode.cpp: -------------------------------------------------------------------------------- 1 | #include "expnode.h" 2 | 3 | ExpNode::ExpNode() 4 | { 5 | this->setTitle("Exp"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(221,38,118)); 9 | this->setPanelGradColor(QColor(255,81,47)); 10 | 11 | this->functionName="exp"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/expnode.h: -------------------------------------------------------------------------------- 1 | #ifndef EXPNODE_H 2 | #define EXPNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class ExpNode:public NodeCore 8 | { 9 | public: 10 | ExpNode(); 11 | }; 12 | 13 | #endif // EXPNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/fabsnode.cpp: -------------------------------------------------------------------------------- 1 | #include "fabsnode.h" 2 | 3 | FabsNode::FabsNode() 4 | { 5 | this->setTitle("Fabs"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(Qt::magenta)); 9 | this->setPanelGradColor(QColor(0,131,176)); 10 | 11 | this->functionName="math.fabs"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/fabsnode.h: -------------------------------------------------------------------------------- 1 | #ifndef FABSNODE_H 2 | #define FABSNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class FabsNode : public NodeCore 8 | { 9 | public: 10 | FabsNode(); 11 | }; 12 | 13 | #endif // FABSNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/factorialnode.cpp: -------------------------------------------------------------------------------- 1 | #include "factorialnode.h" 2 | 3 | FactorialNode::FactorialNode() 4 | { 5 | this->setTitle("Factorial"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(Qt::magenta)); 9 | this->setPanelGradColor(QColor(0,131,176)); 10 | 11 | this->functionName="math.factorial"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/factorialnode.h: -------------------------------------------------------------------------------- 1 | #ifndef FACTORIALNODE_H 2 | #define FACTORIALNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class FactorialNode : public NodeCore 8 | { 9 | public: 10 | FactorialNode(); 11 | }; 12 | 13 | #endif // FACTORIALNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/floornode.cpp: -------------------------------------------------------------------------------- 1 | #include "floornode.h" 2 | 3 | FloorNode::FloorNode() 4 | { 5 | this->setTitle("Floor"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(Qt::magenta)); 9 | this->setPanelGradColor(QColor(0,131,176)); 10 | 11 | this->functionName="math.floor"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/floornode.h: -------------------------------------------------------------------------------- 1 | #ifndef FLOORNODE_H 2 | #define FLOORNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class FloorNode : public NodeCore 7 | { 8 | public: 9 | FloorNode(); 10 | }; 11 | 12 | #endif // FLOORNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/frexpnode.cpp: -------------------------------------------------------------------------------- 1 | #include "frexpnode.h" 2 | 3 | FrexpNode::FrexpNode() 4 | { 5 | this->setTitle("Frexp"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(Qt::magenta)); 9 | this->setPanelGradColor(QColor(0,131,176)); 10 | 11 | this->functionName="math.frexp"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/frexpnode.h: -------------------------------------------------------------------------------- 1 | #ifndef FREXPNODE_H 2 | #define FREXPNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class FrexpNode:public NodeCore 7 | { 8 | public: 9 | FrexpNode(); 10 | }; 11 | 12 | #endif // FREXPNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/gammanode.cpp: -------------------------------------------------------------------------------- 1 | #include "gammanode.h" 2 | 3 | 4 | GammaNode::GammaNode() 5 | { 6 | this->setTitle("Gamma"); 7 | this->setHeight(120); 8 | this->setWidth(140); 9 | this->setPanelColor(QColor(0,180,219)); 10 | this->setPanelGradColor(QColor(0,131,176)); 11 | 12 | this->functionName="math.gamma"; 13 | 14 | Port p1; 15 | p1.Parent=this; 16 | p1.Position=QPoint(20,75); 17 | p1.PortColor=panelColor(); 18 | 19 | 20 | 21 | this->inputPort.push_back(p1); 22 | 23 | Port p3; 24 | 25 | p3.Parent=this; 26 | p3.Position=QPoint(125,75); 27 | p3.PortColor=panelGradColor(); 28 | p3.Type=PortType::OutPut; 29 | 30 | this->outputPort.push_back(p3); 31 | 32 | Label l1; 33 | l1.Text="Value"; 34 | l1.Pos=QPoint(40,85); 35 | 36 | 37 | 38 | this->labelList.push_back(l1); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/gammanode.h: -------------------------------------------------------------------------------- 1 | #ifndef GAMMANODE_H 2 | #define GAMMANODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class GammaNode : public NodeCore 8 | { 9 | public: 10 | GammaNode(); 11 | }; 12 | 13 | #endif // GAMMANODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/hypotnode.cpp: -------------------------------------------------------------------------------- 1 | #include "hypotnode.h" 2 | 3 | HypotNode::HypotNode() 4 | { 5 | this->setTitle("Hypot"); 6 | this->setHeight(180); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(121,159,12)); 9 | this->setPanelGradColor(QColor(255,224,0)); 10 | 11 | this->functionName="math.hypot"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,80); 16 | p1.PortColor=this->panelColor(); 17 | 18 | Port p2; 19 | p2.Parent=this; 20 | p2.Position=QPoint(20,130); 21 | p2.PortColor=this->panelColor(); 22 | 23 | 24 | this->inputPort.push_back(p1); 25 | this->inputPort.push_back(p2); 26 | 27 | Port p3; 28 | 29 | p3.Parent=this; 30 | p3.Position=QPoint(125,105); 31 | p3.PortColor=this->panelGradColor(); 32 | p3.Type=PortType::OutPut; 33 | 34 | this->outputPort.push_back(p3); 35 | 36 | Label l1; 37 | l1.Text="X"; 38 | l1.Pos=QPoint(40,90); 39 | 40 | Label l2; 41 | l2.Text="Y"; 42 | l2.Pos=QPoint(40,140); 43 | 44 | this->labelList.push_back(l1); 45 | this->labelList.push_back(l2); 46 | } 47 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/hypotnode.h: -------------------------------------------------------------------------------- 1 | #ifndef HYPOTNODE_H 2 | #define HYPOTNODE_H 3 | #include"NodeSystem/nodecore.h" 4 | 5 | 6 | class HypotNode : public NodeCore 7 | { 8 | public: 9 | HypotNode(); 10 | }; 11 | 12 | #endif // HYPOTNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/lgammanode.cpp: -------------------------------------------------------------------------------- 1 | #include "lgammanode.h" 2 | 3 | LGammaNode::LGammaNode() 4 | { 5 | this->setTitle("LGamma"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(0,180,219)); 9 | this->setPanelGradColor(QColor(0,131,176)); 10 | 11 | this->functionName="math.lgamma"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/lgammanode.h: -------------------------------------------------------------------------------- 1 | #ifndef LGAMMANODE_H 2 | #define LGAMMANODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | 8 | class LGammaNode : public NodeCore 9 | { 10 | public: 11 | LGammaNode(); 12 | }; 13 | 14 | #endif // LGAMMANODE_H 15 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/lognode.cpp: -------------------------------------------------------------------------------- 1 | #include "lognode.h" 2 | 3 | LogNode::LogNode() 4 | { 5 | 6 | this->setTitle("Log"); 7 | this->setHeight(180); 8 | this->setWidth(150); 9 | this->setPanelColor(QColor(66,134,244)); 10 | this->setPanelGradColor(QColor(255,224,0)); 11 | 12 | this->functionName="math.log"; 13 | 14 | Port p1; 15 | p1.Parent=this; 16 | p1.Position=QPoint(20,80); 17 | p1.PortColor=this->panelColor(); 18 | 19 | Port p2; 20 | p2.Parent=this; 21 | p2.Position=QPoint(20,130); 22 | p2.PortColor=this->panelColor(); 23 | 24 | 25 | this->inputPort.push_back(p1); 26 | this->inputPort.push_back(p2); 27 | 28 | Port p3; 29 | 30 | p3.Parent=this; 31 | p3.Position=QPoint(125,105); 32 | p3.PortColor=this->panelGradColor(); 33 | p3.Type=PortType::OutPut; 34 | 35 | this->outputPort.push_back(p3); 36 | 37 | Label l1; 38 | l1.Text="Value"; 39 | l1.Pos=QPoint(40,90); 40 | 41 | Label l2; 42 | l2.Text="Base"; 43 | l2.Pos=QPoint(40,140); 44 | 45 | this->labelList.push_back(l1); 46 | this->labelList.push_back(l2); 47 | } 48 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/lognode.h: -------------------------------------------------------------------------------- 1 | #ifndef LOGNODE_H 2 | #define LOGNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class LogNode : public NodeCore 8 | { 9 | public: 10 | LogNode(); 11 | }; 12 | 13 | #endif // LOGNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/pinode.cpp: -------------------------------------------------------------------------------- 1 | #include "pinode.h" 2 | 3 | PiNode::PiNode() 4 | { 5 | this->setTitle("PI"); 6 | this->setHeight(120); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(Qt::green)); 9 | this->setPanelGradColor(QColor(Qt::red)); 10 | 11 | this->functionName="math.pi"; 12 | 13 | Port p; 14 | p.Parent=this; 15 | p.Position=QPoint(125,75); 16 | p.PortColor=panelGradColor(); 17 | p.Type=PortType::OutPut; 18 | 19 | Label n; 20 | n.Text="const"; 21 | n.Pos=QPoint(10,82); 22 | 23 | this->labelList.push_back(n); 24 | 25 | this->outputPort.push_back(p); 26 | } 27 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/pinode.h: -------------------------------------------------------------------------------- 1 | #ifndef PINODE_H 2 | #define PINODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class PiNode : public NodeCore 7 | { 8 | public: 9 | PiNode(); 10 | }; 11 | 12 | #endif // PINODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/pownode.cpp: -------------------------------------------------------------------------------- 1 | #include "pownode.h" 2 | 3 | PowNode::PowNode() 4 | { 5 | this->setTitle("Pow"); 6 | this->setHeight(180); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(66,134,244)); 9 | this->setPanelGradColor(QColor(255,224,0)); 10 | 11 | this->functionName="math.pow"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,80); 16 | p1.PortColor=this->panelColor(); 17 | 18 | Port p2; 19 | p2.Parent=this; 20 | p2.Position=QPoint(20,130); 21 | p2.PortColor=this->panelColor(); 22 | 23 | 24 | this->inputPort.push_back(p1); 25 | this->inputPort.push_back(p2); 26 | 27 | Port p3; 28 | 29 | p3.Parent=this; 30 | p3.Position=QPoint(125,105); 31 | p3.PortColor=this->panelGradColor(); 32 | p3.Type=PortType::OutPut; 33 | 34 | this->outputPort.push_back(p3); 35 | 36 | Label l1; 37 | l1.Text="Value"; 38 | l1.Pos=QPoint(40,90); 39 | 40 | Label l2; 41 | l2.Text="Power"; 42 | l2.Pos=QPoint(40,140); 43 | 44 | this->labelList.push_back(l1); 45 | this->labelList.push_back(l2); 46 | } 47 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/pownode.h: -------------------------------------------------------------------------------- 1 | #ifndef POWNODE_H 2 | #define POWNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class PowNode : public NodeCore 8 | { 9 | public: 10 | PowNode(); 11 | }; 12 | 13 | #endif // POWNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/radiansnode.cpp: -------------------------------------------------------------------------------- 1 | #include "radiansnode.h" 2 | 3 | RadiansNode::RadiansNode() 4 | { 5 | this->setTitle("Radians"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(253,200,48)); 9 | this->setPanelGradColor(QColor(243,115,53)); 10 | 11 | this->functionName="math.radians"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/radiansnode.h: -------------------------------------------------------------------------------- 1 | #ifndef RADIANSNODE_H 2 | #define RADIANSNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class RadiansNode : public NodeCore 7 | { 8 | public: 9 | RadiansNode(); 10 | }; 11 | 12 | #endif // RADIANSNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/sinhnode.cpp: -------------------------------------------------------------------------------- 1 | #include "sinhnode.h" 2 | 3 | SinHNode::SinHNode() 4 | { 5 | this->setTitle("Sinh"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(195,20,50)); 9 | this->setPanelGradColor(QColor(36,11,54)); 10 | 11 | this->functionName="math.sinh"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/sinhnode.h: -------------------------------------------------------------------------------- 1 | #ifndef SINHNODE_H 2 | #define SINHNODE_H 3 | #include"NodeSystem/nodecore.h" 4 | 5 | 6 | class SinHNode : public NodeCore 7 | { 8 | public: 9 | SinHNode(); 10 | }; 11 | 12 | #endif // SINHNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/sinnode.cpp: -------------------------------------------------------------------------------- 1 | #include "sinnode.h" 2 | 3 | SinNode::SinNode() 4 | { 5 | this->setTitle("Sin"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(221,38,118)); 9 | this->setPanelGradColor(QColor(255,81,47)); 10 | 11 | this->functionName="math.sin"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/sinnode.h: -------------------------------------------------------------------------------- 1 | #ifndef SINNODE_H 2 | #define SINNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class SinNode : public NodeCore 7 | { 8 | public: 9 | SinNode(); 10 | }; 11 | 12 | #endif // SINNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/sqrtnode.cpp: -------------------------------------------------------------------------------- 1 | #include "sqrtnode.h" 2 | 3 | SqrtNode::SqrtNode() 4 | { 5 | this->setTitle("Sqrt"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(221,38,118)); 9 | this->setPanelGradColor(QColor(255,81,47)); 10 | 11 | this->functionName="math.sqrt"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/sqrtnode.h: -------------------------------------------------------------------------------- 1 | #ifndef SQRTNODE_H 2 | #define SQRTNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class SqrtNode : public NodeCore 7 | { 8 | public: 9 | SqrtNode(); 10 | }; 11 | 12 | #endif // SQRTNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/tanhnode.cpp: -------------------------------------------------------------------------------- 1 | #include "tanhnode.h" 2 | 3 | TanHNode::TanHNode() 4 | { 5 | this->setTitle("Tanh"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(195,20,50)); 9 | this->setPanelGradColor(QColor(36,11,54)); 10 | 11 | this->functionName="math.tanh"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | } 39 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/tanhnode.h: -------------------------------------------------------------------------------- 1 | #ifndef TANHNODE_H 2 | #define TANHNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class TanHNode : public NodeCore 8 | { 9 | public: 10 | TanHNode(); 11 | }; 12 | 13 | #endif // TANHNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/tannode.cpp: -------------------------------------------------------------------------------- 1 | #include "tannode.h" 2 | 3 | tannode::tannode() 4 | { 5 | this->setTitle("Tan"); 6 | this->setHeight(120); 7 | this->setWidth(140); 8 | this->setPanelColor(QColor(221,38,118)); 9 | this->setPanelGradColor(QColor(255,81,47)); 10 | 11 | this->functionName="math.tan"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,75); 16 | p1.PortColor=panelColor(); 17 | 18 | 19 | 20 | this->inputPort.push_back(p1); 21 | 22 | Port p3; 23 | 24 | p3.Parent=this; 25 | p3.Position=QPoint(125,75); 26 | p3.PortColor=panelGradColor(); 27 | p3.Type=PortType::OutPut; 28 | 29 | this->outputPort.push_back(p3); 30 | 31 | Label l1; 32 | l1.Text="Value"; 33 | l1.Pos=QPoint(40,85); 34 | 35 | 36 | 37 | this->labelList.push_back(l1); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /NodeSystem/Derived/math/tannode.h: -------------------------------------------------------------------------------- 1 | #ifndef TANNODE_H 2 | #define TANNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class tannode : public NodeCore 7 | { 8 | public: 9 | tannode(); 10 | }; 11 | 12 | #endif // TANNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/modulonode.cpp: -------------------------------------------------------------------------------- 1 | #include "modulonode.h" 2 | 3 | ModuloNode::ModuloNode() 4 | { 5 | 6 | this->setTitle("Modulo"); 7 | this->setHeight(180); 8 | this->setWidth(150); 9 | this->setPanelColor(QColor(240,152,25)); 10 | this->setPanelGradColor(QColor(237, 222, 93)); 11 | 12 | this->functionName="modulo"; 13 | 14 | Port p1; 15 | p1.Parent=this; 16 | p1.Position=QPoint(20,80); 17 | p1.PortColor=panelColor(); 18 | 19 | Port p2; 20 | p2.Parent=this; 21 | p2.Position=QPoint(20,130); 22 | p2.PortColor=panelColor(); 23 | 24 | 25 | this->inputPort.push_back(p1); 26 | this->inputPort.push_back(p2); 27 | 28 | Port p3; 29 | 30 | p3.Parent=this; 31 | p3.Position=QPoint(125,105); 32 | p3.PortColor=panelGradColor(); 33 | p3.Type=PortType::OutPut; 34 | 35 | this->outputPort.push_back(p3); 36 | 37 | Label l1; 38 | l1.Text="A"; 39 | l1.Pos=QPoint(40,90); 40 | 41 | Label l2; 42 | l2.Text="B"; 43 | l2.Pos=QPoint(40,140); 44 | 45 | this->labelList.push_back(l1); 46 | this->labelList.push_back(l2); 47 | } 48 | -------------------------------------------------------------------------------- /NodeSystem/Derived/modulonode.h: -------------------------------------------------------------------------------- 1 | #ifndef MODULONODE_H 2 | #define MODULONODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class ModuloNode : public NodeCore 7 | { 8 | public: 9 | ModuloNode(); 10 | }; 11 | 12 | #endif // MODULONODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/multiplynode.cpp: -------------------------------------------------------------------------------- 1 | #include "multiplynode.h" 2 | 3 | Multiply::Multiply() 4 | { 5 | this->setTitle("Multiply"); 6 | this->setHeight(180); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(142,68,173)); 9 | this->setPanelGradColor(QColor(86, 101, 115)); 10 | 11 | this->functionName="multiply"; 12 | 13 | Port p1; 14 | p1.Parent=this; 15 | p1.Position=QPoint(20,80); 16 | p1.PortColor=this->panelColor(); 17 | 18 | Port p2; 19 | p2.Parent=this; 20 | p2.Position=QPoint(20,130); 21 | p2.PortColor=this->panelColor(); 22 | 23 | 24 | this->inputPort.push_back(p1); 25 | this->inputPort.push_back(p2); 26 | 27 | Port p3; 28 | 29 | p3.Parent=this; 30 | p3.Position=QPoint(125,105); 31 | p3.PortColor=this->panelGradColor(); 32 | p3.Type=PortType::OutPut; 33 | 34 | this->outputPort.push_back(p3); 35 | 36 | Label l1; 37 | l1.Text="A"; 38 | l1.Pos=QPoint(40,90); 39 | 40 | Label l2; 41 | l2.Text="B"; 42 | l2.Pos=QPoint(40,140); 43 | 44 | this->labelList.push_back(l1); 45 | this->labelList.push_back(l2); 46 | } 47 | -------------------------------------------------------------------------------- /NodeSystem/Derived/multiplynode.h: -------------------------------------------------------------------------------- 1 | #ifndef MULTIPLYNODE_H 2 | #define MULTIPLYNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | 7 | class Multiply : public NodeCore 8 | { 9 | public: 10 | Multiply(); 11 | }; 12 | 13 | #endif // MULTIPLYNODE_H 14 | -------------------------------------------------------------------------------- /NodeSystem/Derived/printnode.cpp: -------------------------------------------------------------------------------- 1 | #include "printnode.h" 2 | 3 | PrintNode::PrintNode() 4 | { 5 | this->setTitle("Print"); 6 | this->setHeight(120); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(165,42,42)); 9 | this->setPanelGradColor(QColor(Qt::yellow)); 10 | 11 | this->functionName="print"; 12 | 13 | Port p; 14 | p.Parent=this; 15 | p.Position=QPoint(20,70); 16 | p.PortColor=panelGradColor(); 17 | this->inputPort.push_back(p); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /NodeSystem/Derived/printnode.h: -------------------------------------------------------------------------------- 1 | #ifndef PRINTNODE_H 2 | #define PRINTNODE_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class PrintNode : public NodeCore 7 | { 8 | public: 9 | PrintNode(); 10 | }; 11 | 12 | #endif // PRINTNODE_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/subtract.cpp: -------------------------------------------------------------------------------- 1 | #include "subtract.h" 2 | 3 | Subtract::Subtract() 4 | { 5 | 6 | this->setTitle("Subtract"); 7 | this->setHeight(180); 8 | this->setWidth(150); 9 | this->setPanelColor(QColor(7,138,123)); 10 | this->setPanelGradColor(QColor(45,53,187)); 11 | 12 | this->functionName="subtract"; 13 | 14 | Port p1; 15 | p1.Parent=this; 16 | p1.Position=QPoint(20,80); 17 | p1.PortColor=panelColor(); 18 | 19 | Port p2; 20 | p2.Parent=this; 21 | p2.Position=QPoint(20,130); 22 | p2.PortColor=panelColor(); 23 | 24 | 25 | this->inputPort.push_back(p1); 26 | this->inputPort.push_back(p2); 27 | 28 | Port p3; 29 | 30 | p3.Parent=this; 31 | p3.Position=QPoint(125,105); 32 | p3.PortColor=panelGradColor(); 33 | p3.Type=PortType::OutPut; 34 | 35 | this->outputPort.push_back(p3); 36 | 37 | Label l1; 38 | l1.Text="A"; 39 | l1.Pos=QPoint(40,90); 40 | 41 | Label l2; 42 | l2.Text="B"; 43 | l2.Pos=QPoint(40,140); 44 | 45 | this->labelList.push_back(l1); 46 | this->labelList.push_back(l2); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /NodeSystem/Derived/subtract.h: -------------------------------------------------------------------------------- 1 | #ifndef SUBTRACT_H 2 | #define SUBTRACT_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class Subtract : public NodeCore 7 | { 8 | public: 9 | Subtract(); 10 | }; 11 | 12 | #endif // SUBTRACT_H 13 | -------------------------------------------------------------------------------- /NodeSystem/Derived/var1d.cpp: -------------------------------------------------------------------------------- 1 | #include "var1d.h" 2 | 3 | Var1D::Var1D() 4 | { 5 | this->setTitle("Var 1D"); 6 | this->setHeight(120); 7 | this->setWidth(150); 8 | this->setPanelColor(QColor(Qt::green)); 9 | this->setPanelGradColor(QColor(10,160,45)); 10 | 11 | this->functionName=""; 12 | 13 | Port p; 14 | p.Parent=this; 15 | p.Position=QPoint(125,75); 16 | p.PortColor=panelGradColor(); 17 | p.Type=PortType::OutPut; 18 | 19 | NumberBox n; 20 | n.Pos=QPoint(12,62); 21 | 22 | this->numberBoxList.push_back(n); 23 | 24 | p.NumberBoxList.push_back(n); 25 | 26 | this->outputPort.push_back(p); 27 | 28 | 29 | } 30 | -------------------------------------------------------------------------------- /NodeSystem/Derived/var1d.h: -------------------------------------------------------------------------------- 1 | #ifndef VAR1D_H 2 | #define VAR1D_H 3 | 4 | #include"NodeSystem/nodecore.h" 5 | 6 | class Var1D : public NodeCore 7 | { 8 | public: 9 | Var1D(); 10 | }; 11 | 12 | #endif // VAR1D_H 13 | -------------------------------------------------------------------------------- /NodeSystem/blackboard.cpp: -------------------------------------------------------------------------------- 1 | #include "blackboard.h" 2 | #include"nodecore.h" 3 | 4 | BlackBoard::BlackBoard() 5 | { 6 | setAcceptedMouseButtons(Qt::AllButtons); 7 | } 8 | void BlackBoard::setBackgroundColor(const QColor color) 9 | { 10 | if(m_backgroundColor==color) 11 | return; 12 | else 13 | { 14 | m_backgroundColor=color; 15 | emit onBackgroundColorChanged(m_backgroundColor); 16 | this->update(); 17 | } 18 | } 19 | void BlackBoard::setLargeLineColor(const QColor color) 20 | { 21 | if(m_largeLineColor==color) 22 | return; 23 | else 24 | { 25 | m_largeLineColor=color; 26 | this->update(); 27 | } 28 | } 29 | void BlackBoard::setSmallLineColor(const QColor color) 30 | { 31 | if(m_smallLineColor==color) 32 | return; 33 | else 34 | { 35 | m_smallLineColor=color; 36 | this->update(); 37 | } 38 | } 39 | void BlackBoard::setDimensionSquare(const int a) 40 | { 41 | if(m_squareDimension==a) 42 | return; 43 | else 44 | { 45 | m_squareDimension=a; 46 | m_lock_squareDimension=a; 47 | emit onSquareDimensionChanged(m_squareDimension); 48 | this->update(); 49 | } 50 | } 51 | 52 | void BlackBoard::setSquareNumber(const int a) 53 | { 54 | if(m_squareNumber==a) 55 | return; 56 | else 57 | { 58 | m_squareNumber=a; 59 | emit onSquareDimensionChanged(m_squareNumber); 60 | this->update(); 61 | } 62 | } 63 | 64 | void BlackBoard::setOffsetX(const int x) 65 | { 66 | if(m_offsetX==x) 67 | return; 68 | else 69 | { 70 | m_offsetX=x; 71 | if(m_offsetX>BigBlock()) 72 | { 73 | m_offsetX=m_offsetX%BigBlock(); 74 | } 75 | if (m_offsetX <0) 76 | { 77 | m_offsetX =BigBlock()-abs(m_offsetX)%BigBlock(); 78 | } 79 | 80 | this->update(); 81 | } 82 | } 83 | 84 | void BlackBoard::setOffsetY(const int y) 85 | { 86 | if(m_offsetY==y) 87 | return; 88 | else 89 | { 90 | m_offsetY=y; 91 | if(m_offsetY>BigBlock()) 92 | { 93 | m_offsetY=m_offsetY%BigBlock(); 94 | } 95 | if (m_offsetY <0) 96 | { 97 | m_offsetY =BigBlock()-abs(m_offsetY)%BigBlock(); 98 | } 99 | 100 | this->update(); 101 | } 102 | } 103 | 104 | QColor BlackBoard::backgroundColor() const 105 | { 106 | return m_backgroundColor; 107 | } 108 | QColor BlackBoard::smallLineColor() const 109 | { 110 | return m_smallLineColor; 111 | } 112 | QColor BlackBoard::largeLineColor() const 113 | { 114 | return m_largeLineColor; 115 | } 116 | int BlackBoard::squareDimension() const 117 | { 118 | return m_squareDimension; 119 | } 120 | int BlackBoard::squareNumber() const 121 | { 122 | return m_squareNumber; 123 | } 124 | 125 | int BlackBoard::offsetX() const 126 | { 127 | return m_offsetX; 128 | } 129 | int BlackBoard::offsetY() const 130 | { 131 | return m_offsetY; 132 | } 133 | bool BlackBoard::rightClicked()const 134 | { 135 | return m_righClicked; 136 | } 137 | 138 | 139 | void BlackBoard::paint(QPainter *painter) 140 | { 141 | painter->setRenderHints(QPainter::Antialiasing,true); 142 | painter->setPen(Qt::black); 143 | DrawGridLines(painter); 144 | DrawConnectors(painter); 145 | DrawCurrentLines(painter); 146 | 147 | } 148 | void BlackBoard::DrawGridLines(QPainter *painter) 149 | { 150 | int Width=static_cast(this->width()); 151 | int Height=static_cast(this->height()); 152 | 153 | painter->fillRect(0,0,Width,Height,QBrush(m_backgroundColor)); 154 | 155 | int vertLines=Width/m_squareDimension+1; 156 | int horizLines=Height/m_squareDimension+1; 157 | 158 | painter->drawRect(0,0,Width,Height); 159 | 160 | for(int i=-m_squareDimension;isetPen(QPen(m_largeLineColor,2.5)); 164 | else 165 | painter->setPen(QPen(m_smallLineColor,1)); 166 | 167 | painter->drawLine(i*m_squareDimension+m_offsetX,0,i*m_squareDimension+m_offsetX,Height); 168 | } 169 | for(int i=-m_squareDimension;isetPen(QPen(m_largeLineColor,2.5)); 173 | else 174 | painter->setPen(QPen(m_smallLineColor,1)); 175 | painter->drawLine(0,i*m_squareDimension+m_offsetY,Width,i*m_squareDimension+m_offsetY); 176 | } 177 | } 178 | int BlackBoard::BigBlock() const 179 | { 180 | return m_squareNumber*m_squareDimension; 181 | } 182 | 183 | void BlackBoard::mousePressEvent(QMouseEvent *event) 184 | { 185 | m_isMouseDown=true; 186 | m_mouseDownPosition=event->pos(); 187 | this->setFocus(true); 188 | 189 | //right mouse 190 | 191 | if(event->button()==Qt::RightButton) 192 | { 193 | m_righClicked=true; 194 | emit onRightMouseClickChanged(true); 195 | } 196 | else { 197 | m_righClicked=false; 198 | emit onRightMouseClickChanged(false); 199 | } 200 | } 201 | void BlackBoard::mouseReleaseEvent(QMouseEvent*) 202 | { 203 | m_isMouseDown=false; 204 | m_mouseDownPosition=QPoint(0,0); 205 | } 206 | void BlackBoard::mouseMoveEvent(QMouseEvent *event) 207 | { 208 | if(m_isMouseDown) 209 | { 210 | QPoint p=event->pos()-m_mouseDownPosition; 211 | m_mouseDownPosition=event->pos(); 212 | setOffsetX(m_offsetX+p.x()); 213 | setOffsetY(m_offsetY+p.y()); 214 | MoveNodes(p); 215 | } 216 | } 217 | void BlackBoard::MoveNodes(QPoint q) 218 | { 219 | QObject* cur=static_cast(this); 220 | QObjectList allc=cur->children(); 221 | for(int i=0;i(allc[i]); 224 | if(c!=nullptr) 225 | { 226 | c->setPosition(c->position()+q); 227 | } 228 | } 229 | } 230 | void BlackBoard::wheelEvent(QWheelEvent *event) 231 | { 232 | ZoomAmountModifier(event->delta()); 233 | } 234 | 235 | void BlackBoard::ZoomAmountModifier(int amt) 236 | { 237 | if(amt>0) 238 | { 239 | if(curZoom+0.05fMinZoom) 245 | curZoom-=0.05f; 246 | } 247 | zoom(curZoom); 248 | } 249 | 250 | void BlackBoard::zoom(float amount) 251 | { 252 | 253 | m_squareDimension = static_cast(amount * m_lock_squareDimension); 254 | ZoomNodes(); 255 | update(); 256 | } 257 | void BlackBoard::ZoomNodes() 258 | { 259 | QObject* cur=static_cast(this); 260 | QObjectList allc=cur->children(); 261 | for(int i=0;i(allc[i]); 264 | if(c!=nullptr) 265 | { 266 | c->setScale(static_cast(curZoom)); 267 | } 268 | } 269 | } 270 | 271 | void BlackBoard::keyPressEvent(QKeyEvent *e) 272 | { 273 | if( e->modifiers().testFlag(Qt::ControlModifier)) 274 | { 275 | if(e->key()==Qt::Key::Key_Plus) 276 | { 277 | ZoomAmountModifier(1); 278 | 279 | } 280 | else if(e->key()==Qt::Key::Key_Minus) 281 | { 282 | ZoomAmountModifier(-1); 283 | 284 | } 285 | } 286 | } 287 | void BlackBoard::DrawConnectors(QPainter *painter) 288 | { 289 | QObjectList pare=children(); 290 | for(int i=0;i(pare[i]); 293 | if(c!=nullptr) 294 | { 295 | 296 | for(int j=0;jinputPort.length();j++) 297 | { 298 | if (c->inputPort[j].Target != nullptr) 299 | { 300 | QPoint p1 = c->inputPort[j].Target->GetWorldPosition(); 301 | QPoint p2 = c->inputPort[j].GetWorldPosition(); 302 | 303 | painter->setPen(QPen(c->inputPort[j].PortColor, 5)); 304 | painter->drawLine(p1.x(), p1.y(), p1.x() + 40, p1.y()); 305 | painter->drawLine(p1.x() + 40, p1.y(), p2.x() - 40, p2.y()); 306 | painter->drawLine(p2.x() - 40, p2.y(), p2.x(), p2.y()); 307 | } 308 | 309 | 310 | } 311 | } 312 | } 313 | } 314 | void BlackBoard::DrawCurrentLines(QPainter *e) 315 | { 316 | if(drawCurrentLine) 317 | { 318 | if(currentPortType==PortType::OutPut) 319 | { 320 | QPoint p1=fromCurrentLine; 321 | QPoint p2=toCurrentLine; 322 | 323 | e->setPen(QPen(currentLineColor,5)); 324 | e->drawLine(p1.x(),p1.y(),p1.x()+40,p1.y()); 325 | e->drawLine(p1.x()+40,p1.y(),p2.x()-40,p2.y()); 326 | e->drawLine(p2.x()-40,p2.y(),p2.x(),p2.y()); 327 | 328 | } 329 | else 330 | { 331 | QPoint p1=fromCurrentLine; 332 | QPoint p2=toCurrentLine; 333 | 334 | e->setPen(QPen(currentLineColor,5)); 335 | e->drawLine(p1.x(),p1.y(),p1.x()-40,p1.y()); 336 | e->drawLine(p1.x()-40,p1.y(),p2.x()+40,p2.y()); 337 | e->drawLine(p2.x()+40,p2.y(),p2.x(),p2.y()); 338 | } 339 | } 340 | } 341 | 342 | -------------------------------------------------------------------------------- /NodeSystem/blackboard.h: -------------------------------------------------------------------------------- 1 | #ifndef BLACKBOARD_H 2 | #define BLACKBOARD_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include"port.h" 9 | 10 | class BlackBoard : public QQuickPaintedItem 11 | { 12 | Q_OBJECT 13 | 14 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY onBackgroundColorChanged) 15 | Q_PROPERTY(QColor smallLineColor READ smallLineColor WRITE setSmallLineColor) 16 | Q_PROPERTY(QColor largeLineColor READ largeLineColor WRITE setLargeLineColor) 17 | 18 | Q_PROPERTY(int squareDimension READ squareDimension WRITE setDimensionSquare NOTIFY onSquareDimensionChanged) 19 | Q_PROPERTY(int squareNumber READ squareNumber WRITE setSquareNumber NOTIFY onSquareNumberChanged) 20 | Q_PROPERTY(int offsetX READ offsetX WRITE setOffsetX) 21 | Q_PROPERTY(int offsetY READ offsetY WRITE setOffsetY) 22 | Q_PROPERTY(bool rightClicked READ rightClicked NOTIFY onRightMouseClickChanged) 23 | 24 | public: 25 | BlackBoard(); 26 | QColor backgroundColor() const; 27 | QColor smallLineColor()const; 28 | QColor largeLineColor()const; 29 | int squareDimension() const; 30 | int squareNumber()const; 31 | int offsetX()const; 32 | int offsetY()const; 33 | 34 | Q_INVOKABLE 35 | void zoom(float); 36 | 37 | QPoint fromCurrentLine; 38 | QPoint toCurrentLine; 39 | bool drawCurrentLine; 40 | PortType currentPortType; 41 | QColor currentLineColor; 42 | bool rightClicked()const; 43 | 44 | protected: 45 | void paint(QPainter*)override; 46 | void mouseMoveEvent(QMouseEvent*) override; 47 | void mousePressEvent(QMouseEvent*) override; 48 | void mouseReleaseEvent(QMouseEvent*) override; 49 | void wheelEvent(QWheelEvent*) override; 50 | void keyPressEvent(QKeyEvent*) override; 51 | 52 | signals: 53 | void onBackgroundColorChanged(const QColor &color); 54 | void onSquareDimensionChanged(const int &dim); 55 | void onSquareNumberChanged(const int &n); 56 | void onRightMouseClickChanged(const bool&); 57 | 58 | public slots: 59 | void setBackgroundColor(const QColor backgroundColor); 60 | void setSmallLineColor(const QColor color); 61 | void setLargeLineColor(const QColor color); 62 | 63 | void setDimensionSquare(const int a); 64 | void setSquareNumber(const int n); 65 | void setOffsetX(const int x); 66 | void setOffsetY(const int y); 67 | 68 | private: 69 | QColor m_backgroundColor=QColor(50,50,50); 70 | QColor m_smallLineColor=QColor(38,38,38); 71 | QColor m_largeLineColor=QColor(28,28,28); 72 | 73 | int m_squareDimension=25; 74 | int m_lock_squareDimension=25; 75 | int m_squareNumber=5; 76 | int m_offsetX=0; 77 | int m_offsetY=0; 78 | 79 | float curZoom = 1; 80 | float MaxZoom=1.25f; 81 | float MinZoom=0.75f; 82 | 83 | QPoint m_mouseDownPosition; 84 | bool m_isMouseDown; 85 | 86 | void DrawGridLines(QPainter*); 87 | void DrawConnectors(QPainter*); 88 | 89 | int BigBlock() const; 90 | 91 | void ZoomAmountModifier(int); 92 | void MoveNodes(QPoint); 93 | void ZoomNodes(); 94 | 95 | void DrawCurrentLines(QPainter*); 96 | 97 | bool m_righClicked; 98 | 99 | }; 100 | 101 | #endif // BLACKBOARD_H 102 | -------------------------------------------------------------------------------- /NodeSystem/checkboxcore.h: -------------------------------------------------------------------------------- 1 | #ifndef CHECKBOXCORE_H 2 | #define CHECKBOXCORE_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | enum CheckBoxState 9 | { 10 | On=1,Off=0 11 | }; 12 | 13 | class CheckBox 14 | { 15 | public: 16 | QPoint Pos; 17 | CheckBoxState State=CheckBoxState::Off; 18 | QColor BackColor=QColor(52,52,52); 19 | QColor FillColor=QColor(30,141,255); 20 | QColor TickColor=QColor(Qt::white); 21 | QColor BorderColor=QColor(Qt::black); 22 | int Width=20; 23 | int Height=20; 24 | 25 | QString getValue() 26 | { 27 | return State==1?"true":"false"; 28 | } 29 | void DrawBody(QPainter *e) 30 | { 31 | e->setPen(BorderColor); 32 | e->drawRect(Pos.x(),Pos.y(),Width,Height); 33 | 34 | if(State==CheckBoxState::Off) 35 | { 36 | e->fillRect(Pos.x(),Pos.y(),Width,Height,BackColor); 37 | } 38 | else 39 | { 40 | e->fillRect(Pos.x(),Pos.y(),Width,Height,FillColor); 41 | e->setPen(QPen(TickColor,2)); 42 | QPoint p1=Pos+QPoint(Width/6,1*Height/2); 43 | QPoint p2=Pos+QPoint(2*Width/5,7*Height/9); 44 | QPoint p3=Pos+QPoint(4*Width/5,1*Height/5); 45 | 46 | e->drawLine(p1,p2); 47 | e->drawLine(p2,p3); 48 | } 49 | } 50 | }; 51 | 52 | #endif // CHECKBOXCORE_H 53 | -------------------------------------------------------------------------------- /NodeSystem/comboboxcore.h: -------------------------------------------------------------------------------- 1 | #ifndef COMBOBOXCORE_H 2 | #define COMBOBOXCORE_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | class ComboBox 13 | { 14 | public: 15 | int Width=100; 16 | int Height=26; 17 | int ExtendedHeight=120; 18 | 19 | QPoint Pos; 20 | QFont Font=QFont("Segoe UI",12,-1,true); 21 | QColor BackgroundColor=QColor(60,60,60); 22 | QColor ForeGroundColor=QColor(Qt::white); 23 | QColor BorderColor=QColor(Qt::black); 24 | QColor HighlightColor=QColor(34,141,255); 25 | QColor ListExpandBackgroundColor = QColor(60,60,60); 26 | 27 | QList Choices; 28 | 29 | int CurrentChoice=0; 30 | QString CurrentString() 31 | { 32 | if (CurrentChoice >= 0 && CurrentChoice < Choices.length()) 33 | { 34 | return Choices[CurrentChoice]; 35 | } 36 | else 37 | { 38 | return ""; 39 | } 40 | } 41 | 42 | void DrawBody(QPainter *e,ComboBox *currentComboBox) 43 | { 44 | if(currentComboBox!=nullptr) 45 | { 46 | QFontMetrics f(Font); 47 | f.width(Choices[CurrentChoice]); 48 | int y=f.height(); 49 | e->fillRect(Pos.x(),Pos.y(),Width,ExtendedHeight,ListExpandBackgroundColor); 50 | 51 | //display arrow 52 | QFont ArrowFont = QFont("Arial"); 53 | e->setFont(ArrowFont); 54 | e->drawText(QPoint(Width/2-5, 20)+Pos, "^"); 55 | e->drawText(QPoint(Width/2-5, ExtendedHeight-4) + Pos, "v"); 56 | e->setFont(Font); 57 | 58 | 59 | if (CurrentChoice != 0) 60 | { 61 | for (int i = CurrentChoice - 1; i <= CurrentChoice + 1; i++) 62 | { 63 | if (i >= 0 && i < Choices.length()) 64 | { 65 | if (i == CurrentChoice) 66 | { 67 | e->fillRect(Pos.x(), Pos.y() + (1.5f) * y + y / 3, Width, Height, HighlightColor); 68 | } 69 | QPoint p = Pos + QPoint(5, Pos.y() + (i - CurrentChoice) * y + y / 3); 70 | e->drawText(p, Choices[i]); 71 | } 72 | } 73 | } 74 | else 75 | 76 | { 77 | for (int i = 0; i <= 2; i++) 78 | { 79 | if (i < Choices.length()) 80 | { 81 | if (i == CurrentChoice) 82 | { 83 | e->fillRect(Pos.x(), Pos.y() + (0.5f) * y + y / 3, Width, Height, HighlightColor); 84 | } 85 | QPoint p = Pos + QPoint(5, Pos.y() + (i - CurrentChoice - 1) * y + y / 3); 86 | e->drawText(p, Choices[i]); 87 | } 88 | } 89 | } 90 | 91 | } 92 | else 93 | { 94 | //Draw Text 95 | QFontMetrics f(Font); 96 | f.width(Choices[CurrentChoice]); 97 | int y=f.height(); 98 | e->setPen(ForeGroundColor); 99 | e->setFont(Font); 100 | QString text=Choices[CurrentChoice]; 101 | QPoint p=Pos+QPoint(5,2*y/3); 102 | e->fillRect(Pos.x(),Pos.y(),Width,Height,BackgroundColor); 103 | e->drawText(p,text); 104 | 105 | } 106 | } 107 | void KeyPress(QKeyEvent* e,QQuickItem* node) 108 | { 109 | if (e->key() == Qt::Key::Key_Up) 110 | { 111 | if (CurrentChoice > 0) 112 | { 113 | CurrentChoice--; 114 | } 115 | } 116 | else if (e->key() == Qt::Key::Key_Return) 117 | { 118 | node->setFocus(false); 119 | } 120 | else if (e->key() == Qt::Key::Key_Down) 121 | 122 | { 123 | if (CurrentChoice < Choices.length() - 1) 124 | { 125 | CurrentChoice++; 126 | } 127 | } 128 | 129 | } 130 | }; 131 | 132 | #endif // COMBOBOXCORE_H 133 | -------------------------------------------------------------------------------- /NodeSystem/cursor.cpp: -------------------------------------------------------------------------------- 1 | #include "cursor.h" 2 | 3 | Cursor::Cursor(QObject *parent) : QObject(parent) 4 | { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /NodeSystem/cursor.h: -------------------------------------------------------------------------------- 1 | #ifndef CURSOR_H 2 | #define CURSOR_H 3 | 4 | #include 5 | #include 6 | class Cursor : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit Cursor(QObject *parent = nullptr); 11 | Q_INVOKABLE QPoint getCursor(int x,int y) {return QCursor::pos()-QPoint(x,y); } //Get 12 | 13 | signals: 14 | 15 | public slots: 16 | 17 | }; 18 | 19 | #endif // CURSOR_H 20 | -------------------------------------------------------------------------------- /NodeSystem/labelcore.h: -------------------------------------------------------------------------------- 1 | #ifndef LABELCORE_H 2 | #define LABELCORE_H 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class Label 10 | { 11 | public: 12 | QString Text; 13 | QFont Font=QFont("Segoe UI",12,-1,true); 14 | QPoint Pos=QPoint(0,0); 15 | QColor Color=QColor(Qt::white); 16 | 17 | QString getValue() 18 | { 19 | return Text; 20 | } 21 | 22 | void DrawBody(QPainter *e) 23 | { 24 | e->setPen(Color); 25 | e->setFont(Font); 26 | e->drawText(Pos,Text); 27 | } 28 | }; 29 | 30 | #endif // LABELCORE_H 31 | -------------------------------------------------------------------------------- /NodeSystem/nodecore.cpp: -------------------------------------------------------------------------------- 1 | #include "nodecore.h" 2 | 3 | NodeCore::NodeCore() 4 | { 5 | setAcceptedMouseButtons(Qt::AllButtons); 6 | } 7 | 8 | 9 | void NodeCore::setBackgroundColor(const QColor color) 10 | { 11 | if(color==m_backgroundColor) 12 | return; 13 | else 14 | { 15 | m_backgroundColor=color; 16 | update(); 17 | } 18 | } 19 | void NodeCore::setHighlightColor(const QColor color) 20 | { 21 | if(color==m_highlightColor) 22 | return; 23 | else 24 | { 25 | m_highlightColor=color; 26 | update(); 27 | } 28 | } 29 | void NodeCore::setPanelColor(const QColor color) 30 | { 31 | if(color==m_panelColor) 32 | return; 33 | else 34 | { 35 | m_panelColor=color; 36 | update(); 37 | } 38 | } 39 | void NodeCore::setPanelGradColor(const QColor color) 40 | { 41 | if(color==m_panelGradColor) 42 | return; 43 | else 44 | { 45 | m_panelGradColor=color; 46 | update(); 47 | } 48 | } 49 | void NodeCore::setTitleFont(const QFont f) 50 | { 51 | if(f==m_titleFont) 52 | return; 53 | else 54 | { 55 | m_titleFont=f; 56 | update(); 57 | } 58 | } 59 | void NodeCore::setPanelHeight(const int h) 60 | { 61 | if(h==m_panelHeight) 62 | return; 63 | else 64 | { 65 | m_panelHeight=h; 66 | update(); 67 | } 68 | } 69 | void NodeCore::setTitleColor(const QColor c) 70 | { 71 | if(c==m_titleColor) 72 | return; 73 | else 74 | { 75 | m_titleColor=c; 76 | update(); 77 | } 78 | } 79 | void NodeCore::setTitle(const QString c) 80 | { 81 | if(c==m_title) 82 | return; 83 | else 84 | { 85 | m_title=c; 86 | update(); 87 | } 88 | } 89 | 90 | QColor NodeCore::backgroundColor() const 91 | { 92 | return m_backgroundColor; 93 | } 94 | QColor NodeCore::highlightColor() const 95 | { 96 | return m_highlightColor; 97 | } 98 | QColor NodeCore::panelColor() const 99 | { 100 | return m_panelColor; 101 | } 102 | QColor NodeCore::panelGradColor() const 103 | { 104 | return m_panelGradColor; 105 | } 106 | QColor NodeCore::titleColor() const 107 | { 108 | return m_titleColor; 109 | } 110 | QString NodeCore::title() const 111 | { 112 | return m_title; 113 | } 114 | QFont NodeCore::titleFont() const 115 | { 116 | return m_titleFont; 117 | } 118 | int NodeCore::panelHeight() const 119 | { 120 | return m_panelHeight; 121 | } 122 | 123 | 124 | 125 | 126 | void NodeCore::paint(QPainter *painter) 127 | { 128 | DrawBody(painter); 129 | DrawTitle(painter); 130 | DrawPorts(painter); 131 | DrawLabels(painter); 132 | DrawCheckBoxes(painter); 133 | DrawNumberBoxes(painter); 134 | DrawComboBoxes(painter); 135 | DrawTextBoxes(painter); 136 | } 137 | void NodeCore::DrawBody(QPainter *painter) 138 | { 139 | int w=static_cast(width()); 140 | int h=static_cast(height()); 141 | 142 | painter->fillRect(0,0,w,h,QBrush(m_backgroundColor)); 143 | 144 | QLinearGradient g(QPoint(0,0),QPoint(w,m_panelHeight)); 145 | g.setColorAt(0,m_panelColor); 146 | g.setColorAt(1,m_panelGradColor); 147 | painter->fillRect(0,0,w,m_panelHeight,QBrush(g)); 148 | 149 | 150 | painter->setPen(m_highlightColor); 151 | painter->drawRect(1,1,w-2,h-2); 152 | painter->drawRect(1,1,w,m_panelHeight-2); 153 | 154 | 155 | } 156 | void NodeCore::DrawTitle(QPainter *e) 157 | { 158 | e->setPen(m_titleColor); 159 | e->setFont(m_titleFont); 160 | QFontMetrics f(m_titleFont); 161 | int x=f.width(m_title); 162 | int y=f.height(); 163 | e->drawText(x/2,y,m_title); 164 | } 165 | void NodeCore::DrawPorts(QPainter *e) 166 | { 167 | e->setRenderHint(QPainter::RenderHint::Antialiasing,true); 168 | for(int i=0;isetBrush(inputPort[i].PortColor); 171 | int r=static_cast(inputPort[i].Radius); 172 | e->drawEllipse(inputPort[i].Position,r,r); 173 | } 174 | for(int i=0;isetBrush(outputPort[i].PortColor); 177 | int r=static_cast(outputPort[i].Radius); 178 | e->drawEllipse(outputPort[i].Position,r,r); 179 | } 180 | } 181 | void NodeCore::DrawLabels(QPainter *e) 182 | { 183 | for(int i=0;i0&&p.x()<=width()) 222 | { 223 | if(p.y()>0 && p.y()<=panelHeight()) 224 | return true; 225 | } 226 | return false; 227 | } 228 | 229 | 230 | void NodeCore::mousePressEvent(QMouseEvent *e) 231 | { 232 | setFocus(true); 233 | lastMousePosition=e->pos(); 234 | if(IsMouseOnHeader(e->pos())) 235 | { 236 | mouseClickedOnHeader=true; 237 | } 238 | else 239 | { 240 | PortClickHelper(e->pos()); 241 | CheckBoxClickHelper(e->pos()); 242 | NumberBoxClickHelper(e->pos()); 243 | TextBoxClickHelper(e->pos()); 244 | ComboBoxClickHelper(e->pos()); 245 | } 246 | } 247 | 248 | 249 | void NodeCore::mouseMoveEvent(QMouseEvent *e) 250 | { 251 | if(mouseClickedOnHeader) 252 | { 253 | QPoint curr=QPoint(static_cast(position().x()),static_cast(position().y())); 254 | QPoint l=curr-lastMousePosition+e->pos(); 255 | setPosition(l); 256 | } 257 | PortLineMoveHelper(e->pos()); 258 | 259 | } 260 | 261 | void NodeCore::mouseReleaseEvent(QMouseEvent *e) 262 | { 263 | mouseClickedOnHeader=false; 264 | ReleasePortTargeter(e->pos()); 265 | 266 | } 267 | void NodeCore::focusOutEvent(QFocusEvent *e) 268 | { 269 | if(e->lostFocus()) 270 | { 271 | currentNumberBox=nullptr; 272 | currentTextBox=nullptr; 273 | currentComboBox=nullptr; 274 | update(); 275 | } 276 | } 277 | 278 | Port *NodeCore::GetClickedPort(QPoint e) 279 | { 280 | Port* p=nullptr; 281 | 282 | for(int i=0;idrawCurrentLine=true; 312 | b->currentPortType=p->Type; 313 | b->currentLineColor=p->PortColor; 314 | b->fromCurrentLine=p->GetWorldPosition(); 315 | b->toCurrentLine=e+ConvertQPoint(position()); 316 | if(p->Type==PortType::Input) 317 | { 318 | inputPortClicked=true; 319 | 320 | } 321 | else 322 | { 323 | outPutPortClicked=true; 324 | } 325 | currentPort=p; 326 | } 327 | } 328 | 329 | void NodeCore::CheckBoxClickHelper(QPoint e) 330 | { 331 | CheckBox* c=GetClickedCheckBox(e); 332 | if(c!=nullptr) 333 | { 334 | if(c->State==CheckBoxState::On) 335 | { 336 | c->State=CheckBoxState::Off; 337 | } 338 | else 339 | { 340 | c->State=CheckBoxState::On; 341 | } 342 | update(); 343 | } 344 | } 345 | 346 | void NodeCore::ComboBoxClickHelper(QPoint e) 347 | { 348 | ComboBox* c=GetClickedComboBox(e); 349 | if(c!=nullptr) 350 | { 351 | currentComboBox=c; 352 | } 353 | else 354 | { 355 | currentComboBox=nullptr; 356 | 357 | } 358 | update(); 359 | 360 | } 361 | void NodeCore::NumberBoxClickHelper(QPoint e) 362 | { 363 | NumberBox* c=GetClickedNumberBox(e); 364 | if(c!=nullptr) 365 | { 366 | currentNumberBox=c; 367 | } 368 | else 369 | { 370 | currentNumberBox=nullptr; 371 | 372 | } 373 | update(); 374 | 375 | } 376 | void NodeCore::TextBoxClickHelper(QPoint e) 377 | { 378 | TextBox* c=GetClickedTextBox(e); 379 | if(c!=nullptr) 380 | { 381 | currentTextBox=c; 382 | } 383 | else 384 | { 385 | currentTextBox=nullptr; 386 | 387 | } 388 | update(); 389 | 390 | } 391 | void NodeCore::PortLineMoveHelper(QPoint e) 392 | { 393 | if(inputPortClicked||outPutPortClicked) 394 | { 395 | BlackBoard* b=Parent(); 396 | b->toCurrentLine=e+ConvertQPoint(position()); 397 | b->fromCurrentLine=currentPort->GetWorldPosition(); 398 | } 399 | dynamic_cast(parent())->update(); 400 | } 401 | void NodeCore::ReleasePortTargeter(QPoint e) 402 | { 403 | BlackBoard* b = Parent(); 404 | b->drawCurrentLine=false; 405 | b->update(); 406 | if(inputPortClicked) 407 | { 408 | inputPortClicked=false; 409 | Port *p=nullptr; 410 | p=p->GetPortNearestAtPosition(e+ConvertQPoint(position()),parent(),this); 411 | if(p!=nullptr) 412 | { 413 | if(p->Type==PortType::OutPut) 414 | BindPort(p,currentPort); 415 | } 416 | else 417 | { 418 | ConnectionRemover(); 419 | } 420 | } 421 | if(outPutPortClicked) 422 | { 423 | outPutPortClicked=false; 424 | Port *p=nullptr; 425 | p=p->GetPortNearestAtPosition(e+ConvertQPoint(position()),parent(),this); 426 | if(p!=nullptr) 427 | { 428 | if(p->Type==PortType::Input) 429 | BindPort(currentPort,p); 430 | } 431 | else 432 | { 433 | ConnectionRemover(); 434 | } 435 | } 436 | currentPort=nullptr; 437 | } 438 | 439 | QPoint NodeCore::ConvertQPoint(QPointF q) 440 | { 441 | return QPoint(static_cast(q.x()),static_cast(q.y())); 442 | } 443 | 444 | 445 | void NodeCore::BindPort(Port* p1, Port* p2) 446 | { 447 | p2->Target=p1; 448 | p1->InputPort=p2; 449 | } 450 | 451 | bool NodeCore::FindInList(QList list,Port* p) 452 | { 453 | return (std::find(list.begin(), list.end(), p) != list.end()); 454 | } 455 | 456 | BlackBoard* NodeCore::Parent() 457 | { 458 | return dynamic_cast(parent()); 459 | } 460 | void NodeCore::ConnectionRemover() 461 | { 462 | if(currentPort==nullptr) 463 | { 464 | return; 465 | } 466 | if(currentPort->Type==PortType::Input) 467 | { 468 | currentPort->Target=nullptr; 469 | } 470 | else 471 | { 472 | if(currentPort->InputPort!=nullptr) 473 | currentPort->InputPort->Target=nullptr; 474 | } 475 | } 476 | CheckBox* NodeCore::GetClickedCheckBox(QPoint e) 477 | { 478 | CheckBox* p=nullptr; 479 | 480 | for(int i=0;iKeyPress(e); 547 | update(); 548 | } 549 | if(currentTextBox!=nullptr) 550 | { 551 | currentTextBox->KeyPress(e); 552 | update(); 553 | } 554 | if (currentComboBox != nullptr) 555 | { 556 | currentComboBox->KeyPress(e,this); 557 | update(); 558 | } 559 | if(e->key()==Qt::Key::Key_Delete) 560 | { 561 | for (int i=0;iTarget=nullptr; 567 | } 568 | } 569 | this->deleteLater(); 570 | Parent()->update(); 571 | } 572 | } 573 | 574 | QString NodeCore::ResultString() 575 | { 576 | QString Result=functionName; 577 | for(int j=0;j(inputPort[i].Target->Parent)->ResultString(); 615 | if(i!=inputPort.length()-1) 616 | Result+=","; 617 | } 618 | if(inputPort.length()!=0) 619 | Result+=")"; 620 | return Result; 621 | } 622 | -------------------------------------------------------------------------------- /NodeSystem/nodecore.h: -------------------------------------------------------------------------------- 1 | #ifndef NODECORE_H 2 | #define NODECORE_H 3 | 4 | #include 5 | #include 6 | #include "port.h" 7 | #include 8 | #include 9 | #include 10 | #include"blackboard.h" 11 | #include"labelcore.h" 12 | #include"checkboxcore.h" 13 | #include"numberboxcore.h" 14 | #include"textboxcore.h" 15 | #include"comboboxcore.h" 16 | 17 | class NodeCore : public QQuickPaintedItem 18 | { 19 | Q_OBJECT 20 | Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor) 21 | Q_PROPERTY(QColor highlightColor READ highlightColor WRITE setHighlightColor) 22 | Q_PROPERTY(QColor panelColor READ panelColor WRITE setPanelColor) 23 | Q_PROPERTY(QColor panelGradColor READ panelGradColor WRITE setPanelGradColor) 24 | Q_PROPERTY(QColor titleColor READ titleColor WRITE setTitleColor) 25 | Q_PROPERTY(int panelHeight READ panelHeight WRITE setPanelHeight) 26 | Q_PROPERTY(QString title READ title WRITE setTitle) 27 | Q_PROPERTY(QFont titleFont READ titleFont WRITE setTitleFont) 28 | 29 | 30 | public: 31 | NodeCore(); 32 | 33 | QColor backgroundColor() const; 34 | QColor highlightColor()const; 35 | QColor panelColor()const; 36 | QColor panelGradColor()const; 37 | QString title()const; 38 | QColor titleColor()const; 39 | int panelHeight()const; 40 | QFont titleFont()const; 41 | QList inputPort; 42 | QList outputPort; 43 | QList