From 9a3a639ad5b6711fa15e60be6dc152cee43ff30b Mon Sep 17 00:00:00 2001 From: SoTosorrow <50233205+SoTosorrow@users.noreply.github.com> Date: Sat, 22 May 2021 20:03:22 +0800 Subject: [PATCH] cv complete 0.1 --- src/{ => old}/types.h | 0 src/vapour_action_cv.h | 76 ++++++++++++++--- src/vapour_demo.cpp | 47 +++++++++++ src/vapour_descriptor.cpp | 2 +- src/vapour_descriptor.h | 26 +++++- src/vapour_descriptor_cv.h | 58 +++++++++++++ src/vapour_descriptor_develop.h | 55 +++++++++++++ src/vapour_edge.cpp | 8 +- src/vapour_node.cpp | 2 +- src/vapour_node.h | 55 ++++++------- src/vapour_node_cv.h | 142 +++++++++++++++++++++++++++++++- src/vapour_node_develop.h | 73 ++++++++++++++-- src/vapour_view.cpp | 15 +++- 13 files changed, 491 insertions(+), 68 deletions(-) rename src/{ => old}/types.h (100%) diff --git a/src/types.h b/src/old/types.h similarity index 100% rename from src/types.h rename to src/old/types.h diff --git a/src/vapour_action_cv.h b/src/vapour_action_cv.h index 71d996d..c39ae29 100644 --- a/src/vapour_action_cv.h +++ b/src/vapour_action_cv.h @@ -8,16 +8,32 @@ class VapourActionCvShow : public VapourAction { public: VapourActionCvShow(cv::Mat m,int n=1){ - for(int i=0;isetStyleSheet("QPushButton { background-color:gray; border-radius:5px;font-size:20px; }"); - temp->setGeometry(0,i*30,100,25); - edits.append(temp); - } - connect(this->edits[0], &QPushButton::clicked, this, [=](){ - this->edits[0]->setText("CV Test"); - cv::imshow("test",m); - }); + Q_UNUSED(n); + QLineEdit* edit1 = new QLineEdit("1",this); + edit1->setAlignment(Qt::AlignLeft); + edit1->setGeometry(0,0,150,25); + QLineEdit* edit2 = new QLineEdit("1",this); + edit2->setAlignment(Qt::AlignLeft); + edit2->setGeometry(0,30,150,25); + QLineEdit* edit3 = new QLineEdit("1",this); + edit3->setAlignment(Qt::AlignLeft); + edit3->setGeometry(0,60,150,25); + QLineEdit* edit4 = new QLineEdit("1",this); + edit4->setAlignment(Qt::AlignLeft); + edit4->setGeometry(0,90,150,25); + edits.append(edit1); + edits.append(edit2); + edits.append(edit3); + edits.append(edit4); + +// button = new QPushButton("button",this); +// button->setGeometry(0,30,100,25); +// button->setStyleSheet("QPushButton { background-color:gray; border-radius:5px;font-size:20px; }"); + +// connect(button, &QPushButton::clicked, this, [=](){ +// button->setText("CV Test"); +// cv::imshow("test",tm); +// }); } ~VapourActionCvShow(){ qDeleteAll(edits); @@ -25,7 +41,45 @@ class VapourActionCvShow : public VapourAction } public: - QList edits; + QList edits; +// QPushButton* button; + cv::Mat tm; + //QLineEdit* edit; + + + +}; + + +class VapourActionCvInput : public VapourAction +{ +public: + VapourActionCvInput(cv::Mat m,int n=1){ + Q_UNUSED(n); + QLineEdit* edit = new QLineEdit("C:\\Users\\Cuimi\\Desktop\\1.png",this); + edit->setAlignment(Qt::AlignLeft); + edit->setGeometry(0,0,150,25); + edits.append(edit); + +// button = new QPushButton("button",this); +// button->setGeometry(0,30,100,25); +// button->setStyleSheet("QPushButton { background-color:gray; border-radius:5px;font-size:20px; }"); + +// connect(button, &QPushButton::clicked, this, [=](){ +// button->setText("CV Test"); +// cv::imshow("test",tm); +// }); + } + ~VapourActionCvInput(){ + qDeleteAll(edits); + edits.clear(); + } + +public: + QList edits; +// QPushButton* button; + cv::Mat tm; + //QLineEdit* edit; diff --git a/src/vapour_demo.cpp b/src/vapour_demo.cpp index cf2a18a..df36533 100644 --- a/src/vapour_demo.cpp +++ b/src/vapour_demo.cpp @@ -8,11 +8,48 @@ using namespace cv; +class A{ +public: + A(){ + qDebug()<a = 7; + qDebug()<a = 6; + qDebug()<a = new B(); + } + A *a; +}; + int main(int argc, char *argv[]) { QApplication a(argc, argv); QDir::setCurrent(a.applicationDirPath()); // 设置相对路径:是必需的、但能否改动? +// C c; +// c.a->p(); +// qDebug()<a; + + // VideoCapture cap; // cap.open(0); // qDebug()<interaction = new VapourActionButton(edit_number); + this->interaction = new VapourActionEdit(edit_number); this->interaction->setGeometry(edge_size, title_height+0.5*edge_size, width - 2*edge_size,height - 2*edge_size - title_height); this->proxyContent->setWidget(this->interaction); diff --git a/src/vapour_descriptor.h b/src/vapour_descriptor.h index 7fe5d07..8f88e1e 100644 --- a/src/vapour_descriptor.h +++ b/src/vapour_descriptor.h @@ -18,7 +18,7 @@ class VapourDescriptor : public QGraphicsItem VapourDescriptor(int in_num,int out_num,QString node_name,int edit_number=1); VapourDescriptor(const VapourDescriptor& desc); void operator=(const VapourDescriptor &desc); - ~VapourDescriptor(); + virtual ~VapourDescriptor(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override; @@ -67,6 +67,24 @@ class VapourDescriptor : public QGraphicsItem } } + virtual QPointF getPos(){ + return this->pos(); + } + virtual void setText(int n,QString t){ + this->interaction->edits[n]->setText(t); + } + virtual double getText(int n){ + return this->interaction->edits[n]->text().toDouble(); + } + virtual QString getFile(){ + // return this->interaction->edits[0]->text(); + } + virtual void test_T_image(cv::Mat m){ + + } + virtual QList getParams(){ + + } @@ -74,8 +92,8 @@ class VapourDescriptor : public QGraphicsItem // QList params; QList input_sockets; QList output_sockets; - //VapourAction* interaction; - VapourActionButton* interaction; + + VapourActionEdit* interaction; bool can_compute = true; @@ -95,7 +113,7 @@ class VapourDescriptor : public QGraphicsItem public: float width = 180; // 节点宽度 float title_height = 24; - float height = 100; + float height = 200; float edge_size = 10.0; }; diff --git a/src/vapour_descriptor_cv.h b/src/vapour_descriptor_cv.h index 0494216..38f63ec 100644 --- a/src/vapour_descriptor_cv.h +++ b/src/vapour_descriptor_cv.h @@ -9,6 +9,41 @@ class VapourDescriptorCvInput : public VapourDescriptor public: VapourDescriptorCvInput(); VapourDescriptorCvInput(int in_num,int out_num,QString node_name,int edit_number=1) + :VapourDescriptor(in_num,out_num,node_name,edit_number){ + // cv::Mat m(250, 250, CV_8UC3, cv::Scalar(255, 255, 255)); + cv::Mat m = cv::imread("C:\\Users\\Cuimi\\Desktop\\111.jpg"); + interaction = new VapourActionCvInput(m,edit_number); + this->interaction->setGeometry(edge_size, title_height+0.5*edge_size, + width - 2*edge_size,height - 2*edge_size - title_height); + this->proxyContent->setWidget(this->interaction); + } + QPointF getPos() override{ + return this->pos(); + } + void setText(int n,QString t) override{ + Q_UNUSED(n); + Q_UNUSED(t); + //this->interaction->edits[n]->setText(t); + } + QString getFile() override{ + return this->interaction->edits[0]->text(); + } + void test_T_image(cv::Mat m) override{ + this->interaction->tm = m; + } + + +public: + //VapourActionCvShow* interaction; + VapourActionCvInput* interaction; + +}; + +class VapourDescriptorCvAdd : public VapourDescriptor +{ +public: + VapourDescriptorCvAdd(); + VapourDescriptorCvAdd(int in_num,int out_num,QString node_name,int edit_number=1) :VapourDescriptor(in_num,out_num,node_name,edit_number){ // cv::Mat m(250, 250, CV_8UC3, cv::Scalar(255, 255, 255)); cv::Mat m = cv::imread("C:\\Users\\Cuimi\\Desktop\\111.jpg"); @@ -17,8 +52,31 @@ class VapourDescriptorCvInput : public VapourDescriptor width - 2*edge_size,height - 2*edge_size - title_height); this->proxyContent->setWidget(this->interaction); } + QPointF getPos() override{ + return this->pos(); + } + void setText(int n,QString t) override{ + Q_UNUSED(n); + Q_UNUSED(t); + //this->interaction->edits[n]->setText(t); + } + void test_T_image(cv::Mat m) override{ + this->interaction->tm = m; + } + QList getParams() override{ + QList a; + a.append(this->interaction->edits[0]->text()); + a.append(this->interaction->edits[1]->text()); + a.append(this->interaction->edits[2]->text()); + a.append(this->interaction->edits[3]->text()); + return a; + } + + +public: //VapourActionCvShow* interaction; VapourActionCvShow* interaction; + }; #endif // VAPOUR_DESCRIPTOR_CV_H diff --git a/src/vapour_descriptor_develop.h b/src/vapour_descriptor_develop.h index 86592a2..c2803ed 100644 --- a/src/vapour_descriptor_develop.h +++ b/src/vapour_descriptor_develop.h @@ -1,4 +1,59 @@ #ifndef VAPOUR_DESCRIPTOR_DEVELOP_H #define VAPOUR_DESCRIPTOR_DEVELOP_H + +#include"vapour_descriptor.h" + +class VapourDescriptorInput : public VapourDescriptor +{ +public: + VapourDescriptorInput(int in_num,int out_num,QString node_name,int edit_number=1) + :VapourDescriptor(in_num,out_num,node_name,edit_number) + { + this->interaction = new VapourActionEdit(edit_number); + this->interaction->setGeometry(edge_size, title_height+0.5*edge_size, + width - 2*edge_size,height - 2*edge_size - title_height); + this->proxyContent->setWidget(this->interaction); + } + QPointF getPos() override{ + return this->pos(); + } + void setText(int n,QString t) override{ + this->interaction->edits[n]->setText(t); + } + double getText(int n) override{ + return this->interaction->edits[n]->text().toDouble(); + } + +public: + VapourActionEdit* interaction; + +}; + +class VapourDescriptorOutput : public VapourDescriptor +{ +public: + VapourDescriptorOutput(int in_num,int out_num,QString node_name,int edit_number=1) + :VapourDescriptor(in_num,out_num,node_name,edit_number) + { + this->interaction = new VapourActionText(edit_number); + this->interaction->setGeometry(edge_size, title_height+0.5*edge_size, + width - 2*edge_size,height - 2*edge_size - title_height); + this->proxyContent->setWidget(this->interaction); + } + QPointF getPos() override{ + return this->pos(); + } + void setText(int n,QString t) override{ + this->interaction->edits[n]->setText(t); + } + double getText(int n) override{ + return this->interaction->edits[n]->text().toDouble(); + } + +public: + VapourActionText* interaction; + +}; + #endif // VAPOUR_DESCRIPTOR_DEVELOP_H diff --git a/src/vapour_edge.cpp b/src/vapour_edge.cpp index 89627aa..97c5483 100644 --- a/src/vapour_edge.cpp +++ b/src/vapour_edge.cpp @@ -14,8 +14,8 @@ VapourEdge::VapourEdge(VapourNode *start_node, VapourNode *end_node, VapourSocke this->start_socket_pos = start_socket->pos(); this->end_socket_pos = end_socket->pos(); - this->start_pos = start_node->desc->pos() + start_socket_pos; - this->end_pos = end_node->desc->pos() + end_socket_pos; + this->start_pos = start_node->desc->getPos() + start_socket_pos; + this->end_pos = end_node->desc->getPos() + end_socket_pos; this->path = QPainterPath(start_pos); this->setFlag(QGraphicsItem::ItemIsSelectable); @@ -69,8 +69,8 @@ void VapourEdge::paint(QPainter *painter, const QStyleOptionGraphicsItem *option pen1.setWidth(2); QPen pen2(QColor("#228B22")); pen2.setWidth(2); - this->start_pos = this->input_node->desc->pos() + start_socket_pos; - this->end_pos = this->output_node->desc->pos() + end_socket_pos; + this->start_pos = this->input_node->desc->getPos() + start_socket_pos; + this->end_pos = this->output_node->desc->getPos() + end_socket_pos; path = QPainterPath(start_pos); diff --git a/src/vapour_node.cpp b/src/vapour_node.cpp index 8b236fa..71ee8f4 100644 --- a/src/vapour_node.cpp +++ b/src/vapour_node.cpp @@ -6,7 +6,7 @@ VapourNode::VapourNode(QWidget *parent) { // qDebug()<<"Create: Basic Vapour-node"; initDesc(1,1); - this->desc = new VapourDescriptor(input_socket_number,output_socket_number,"test",1); + this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"test",1); } VapourNode::VapourNode(const VapourNode &node, QWidget *parent) diff --git a/src/vapour_node.h b/src/vapour_node.h index dc6a65e..e13f60e 100644 --- a/src/vapour_node.h +++ b/src/vapour_node.h @@ -10,6 +10,7 @@ #include"vapour_types.h" #include"vapour_descriptor.h" #include"vapour_action_develop.h" +#include"vapour_descriptor_develop.h" // 释放 connect_info 内存 class VapourNode : public QWidget @@ -21,49 +22,43 @@ class VapourNode : public QWidget ~VapourNode(); - void setPos(QPointF pos){ - this->desc->setPos(pos); - } void setIndex(int index){ this->index = index; } - void setTitle(QString title){ - this->desc->setTitle(title); - } void initDesc(int in, int out){ this->input_socket_number = in; this->output_socket_number = out; } + virtual void setPos(QPointF pos){ + this->desc->setPos(pos); + } + virtual void setTitle(QString title){ + this->desc->setTitle(title); + } + virtual QPointF getPos(){ + return this->desc->pos(); + } + virtual VapourDescriptor* getDesc(){ + return this->desc; + } virtual void initData(){ - //qDeleteAll(input_datas); - input_datas.clear(); - //qDeleteAll(output_datas); - output_datas.clear(); - for(int i=0;idesc->input_sockets.length();i++){ - input_datas.append({0}); - input_datas[i].data = this->desc->interaction->edits[i]->text().toDouble(); - } - for(int i=0;idesc->output_sockets.length();i++){ - output_datas.append({0}); - } } virtual void handle(){ - qDebug()<<"handle"< getInputDatas(){ + + } + virtual QList getOutputDatas(){ + + } + virtual void setInputDatas(int n,DMat m){ + + } + virtual void setOutputDatas(int n,DMat m){ - for(int i=0;idesc->interaction->edits[i]->setText(QString::number(this->input_datas[i].data)); - } } virtual void transfer(){ - for(int i=0;ioutput_nodes.length();i++){ - qDebug()<connect_info[i].first.first->index<connect_info[i].first.second->index<< - this->connect_info[i].second.first<connect_info[i].second.second; -// for(int j=0;jinput_datas.length();j++) -// qDebug()<input_datas[j].data; - this->connect_info[i].first.second->input_datas[this->connect_info[i].second.second]= - this->connect_info[i].first.first->output_datas[this->connect_info[i].second.first]; - } + qDebug()<<"basic transfer"; } diff --git a/src/vapour_node_cv.h b/src/vapour_node_cv.h index e7e018d..8f5abcc 100644 --- a/src/vapour_node_cv.h +++ b/src/vapour_node_cv.h @@ -8,6 +8,141 @@ class VapourNodeCvInput : public VapourNode { public: VapourNodeCvInput(QWidget *parent=nullptr):VapourNode(parent){ + qDebug()<<"Create: Vapour CV-Input"; + initDesc(1,1); + // 定义节点描述,自动定义节点用户接口 + this->desc = new VapourDescriptorCvInput(input_socket_number,output_socket_number,"Cv-test",2); + // 节点大小 + this->desc->setTitle("CV-test"); + this->desc->setDescWidth(300); + this->desc->setDescHeight(180); + } + void initData() override{ + qDebug()<<"initData"; + //qDeleteAll(input_datas); + input_datas.clear(); + //qDeleteAll(output_datas); + output_datas.clear(); + cv::Mat m; + for(int i=0;idesc->input_sockets.length();i++){ + m = cv::imread(this->getDesc()->getFile().toStdString()); + input_datas.append({m}); + input_datas[i].data = m; + } + for(int i=0;idesc->output_sockets.length();i++){ + output_datas.append({m}); + } + } + void handle() override{ + output_datas[0].data = input_datas[0].data; + + } + void transfer() override{ + for(int i=0;ioutput_nodes.length();i++){ + this->connect_info[i].first.second->setInputDatas(this->connect_info[i].second.second,this->connect_info[i].first.first->getOutputDatas()[0]); + } + cv::imshow("a",output_datas[0].data); + } + QList getInputDatas() override{ + return this->input_datas; + } + QList getOutputDatas() override{ + return this->output_datas; + } + void setInputDatas(int n,DMat m) override{ + this->input_datas[n].data = m.data; + } + void setOutputDatas(int n,DMat m) override{ + this->output_datas[n].data = m.data; + } +// C:\\Users\\Cuimi\\Desktop\\111.jpg +public: + QList input_datas; + QList output_datas; +}; + +class VapourNodeCvAdd : public VapourNode +{ +public: + VapourNodeCvAdd(QWidget *parent=nullptr):VapourNode(parent){ + qDebug()<<"Create: Vapour CV-Input"; + initDesc(2,1); + // 定义节点描述,自动定义节点用户接口 + this->desc = new VapourDescriptorCvAdd(input_socket_number,output_socket_number,"Cv-test",2); + // 节点大小 + this->desc->setTitle("CV-test"); + this->desc->setDescWidth(300); + this->desc->setDescHeight(180); + } + void initData() override{ + qDebug()<<"initData"; + //qDeleteAll(input_datas); + input_datas.clear(); + //qDeleteAll(output_datas); + output_datas.clear(); + cv::Mat m; + for(int i=0;idesc->input_sockets.length();i++){ + input_datas.append({m}); + } + for(int i=0;idesc->output_sockets.length();i++){ + output_datas.append({m}); + } + + } + void handle() override{ + output_datas[0].data = input_datas[0].data + input_datas[1].data; + int x,y,w,h; + x = this->getDesc()->getParams()[0].toInt(); + y = this->getDesc()->getParams()[1].toInt(); + w = this->getDesc()->getParams()[2].toInt(); + h = this->getDesc()->getParams()[3].toInt(); + qDebug()< im = input_datas[0].data; + cv::Mat_ im2 = input_datas[1].data; + qDebug()<output_nodes.length();i++){ + this->connect_info[i].first.second->setInputDatas(this->connect_info[i].second.second,this->connect_info[i].first.first->getOutputDatas()[0]); + } + cv::imshow("a",output_datas[0].data); + } + QList getInputDatas() override{ + return this->input_datas; + } + QList getOutputDatas() override{ + return this->output_datas; + } + void setInputDatas(int n,DMat m) override{ + this->input_datas[n].data = m.data; + } + void setOutputDatas(int n,DMat m) override{ + this->output_datas[n].data = m.data; + } +// C:\\Users\\Cuimi\\Desktop\\111.jpg +public: + QList input_datas; + QList output_datas; + +}; + + +class VapourNodeCvLoad : public VapourNode +{ +public: + VapourNodeCvLoad(QWidget *parent=nullptr):VapourNode(parent){ qDebug()<<"Create: Vapour CV-Input"; initDesc(2,1); // 定义节点描述,自动定义节点用户接口 @@ -17,7 +152,7 @@ class VapourNodeCvInput : public VapourNode this->desc->setDescWidth(300); this->desc->setDescHeight(180); } - virtual void initData(){ + void initData() override{ qDebug()<<"initData"; //qDeleteAll(input_datas); input_datas.clear(); @@ -32,14 +167,14 @@ class VapourNodeCvInput : public VapourNode output_datas.append({m}); } } - virtual void handle(){ + void handle() override{ qDebug()<<"handle"<desc->interaction->edits[i]->setText(QString::number(this->input_datas[i].data)); // } } - virtual void transfer(){ + void transfer() override{ for(int i=0;ioutput_nodes.length();i++){ qDebug()<connect_info[i].first.first->index<connect_info[i].first.second->index<< this->connect_info[i].second.first<connect_info[i].second.second; @@ -57,7 +192,6 @@ class VapourNodeCvInput : public VapourNode }; -// D:\Object\CuteCss\1.jpg #endif // VAPOUR_NODE_CV_H diff --git a/src/vapour_node_develop.h b/src/vapour_node_develop.h index 721c418..ad79ce0 100644 --- a/src/vapour_node_develop.h +++ b/src/vapour_node_develop.h @@ -8,34 +8,89 @@ class VapourNodeInput : public VapourNode public: VapourNodeInput(QWidget *parent=nullptr):VapourNode(parent){ qDebug()<<"Create: Vapour node-Input"; - initDesc(2,1); + initDesc(2,2); // 定义节点描述,自动定义节点用户接口 - this->desc = new VapourDescriptor(input_socket_number,output_socket_number,"Input",2); + this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"Input",2); // 节点大小 this->desc->setDescWidth(160); - this->desc->setDescHeight(130); + this->desc->setDescHeight(120); } - virtual void initData(){ - qDebug()<<"initData"; + void initData() override{ //qDeleteAll(input_datas); input_datas.clear(); //qDeleteAll(output_datas); output_datas.clear(); for(int i=0;idesc->input_sockets.length();i++){ input_datas.append({0}); - input_datas[i].data = this->desc->interaction->edits[i]->text().toDouble(); + input_datas[i].data = this->desc->getText(i); } for(int i=0;idesc->output_sockets.length();i++){ output_datas.append({0}); } } - virtual void handle(){ - qDebug()<<"handle"<desc->interaction->edits[i]->setText(QString::number(this->input_datas[i].data)); + this->desc->setText(i,QString::number(this->input_datas[i].data)); } } + void transfer() override{ + for(int i=0;ioutput_nodes.length();i++){ + qDebug()<connect_info[i].first.first->index<connect_info[i].first.second->index<< + this->connect_info[i].second.first<connect_info[i].second.second; +// for(int j=0;jinput_datas.length();j++) +// qDebug()<input_datas[j].data; + this->connect_info[i].first.second->input_datas[this->connect_info[i].second.second]= + this->connect_info[i].first.first->output_datas[this->connect_info[i].second.first]; + } + } + +}; + +class VapourNodeOutput : public VapourNode +{ +public: + VapourNodeOutput(QWidget *parent=nullptr):VapourNode(parent){ + qDebug()<<"Create: Vapour node-Input"; + initDesc(1,0); + // 定义节点描述,自动定义节点用户接口 + this->desc = new VapourDescriptorOutput(input_socket_number,output_socket_number,"Output",1); + // 节点大小 + this->desc->setDescWidth(200); + this->desc->setDescHeight(80); + } + void initData() override{ + //qDeleteAll(input_datas); + input_datas.clear(); + //qDeleteAll(output_datas); + output_datas.clear(); + + for(int i=0;idesc->input_sockets.length();i++){ + input_datas.append({0}); + input_datas[i].data = this->desc->getText(i); + } + for(int i=0;idesc->output_sockets.length();i++){ + output_datas.append({0}); + } + } + virtual void handle() override{ + // show number + for(int i=0;idesc->setText(i,QString::number(this->input_datas[i].data)); + } + } + void transfer() override{ + for(int i=0;ioutput_nodes.length();i++){ + qDebug()<connect_info[i].first.first->index<connect_info[i].first.second->index<< + this->connect_info[i].second.first<connect_info[i].second.second; +// for(int j=0;jinput_datas.length();j++) +// qDebug()<input_datas[j].data; + this->connect_info[i].first.second->input_datas[this->connect_info[i].second.second]= + this->connect_info[i].first.first->output_datas[this->connect_info[i].second.first]; + } + } + }; diff --git a/src/vapour_view.cpp b/src/vapour_view.cpp index 67cd4a2..37ced0a 100644 --- a/src/vapour_view.cpp +++ b/src/vapour_view.cpp @@ -357,11 +357,18 @@ void VapourView::addNode(int index, int type, QPoint pos) if(type==0){ node = new VapourNodeInput(); } + else if(type==1){ + node = new VapourNodeOutput(); + } else if(type==2){ node = new VapourNodeCvInput(); + node->desc->setDescHeight(100); + } + else if(type==3){ + node = new VapourNodeCvAdd(); } else{ - node = new VapourNode(); + node = new VapourNodeInput(); } node->desc->setDescWidth(200); @@ -643,15 +650,15 @@ void VapourView::contextMenuEvent(QContextMenuEvent *event) addNode(number++,1,pos); }); menu->addSeparator(); - action.append(menu->addAction("Cv-test")); + action.append(menu->addAction("Cv-Load")); connect(action[2], &QAction::triggered, [=]() { addNode(number++,2,pos); }); - action.append(menu->addAction("Shader-Circle")); + action.append(menu->addAction("Cv-Add")); connect(action[3], &QAction::triggered, [=]() { - //addNode(number++,3,pos); + addNode(number++,3,pos); }); action.append(menu->addAction("Number-Mul")); connect(action[4], &QAction::triggered, [=]()