diff --git a/README.md b/README.md index 1766e76..b95b0c1 100644 --- a/README.md +++ b/README.md @@ -11,13 +11,16 @@ 待解决: +解耦Descriptor 序列化与反序列化——json 根据json文档扩建新节点 更便捷的注册新节点,比如在右键菜单加入和在addnode加入 历史记录栈 copy和paste +setHeight 遮住的问题两个Height的问题,是子节点的height被父节点的height遮住了吗?清减这一块问题 -内存还是有一点泄漏,需要检查修复,以及内存释放的问题,包括QList +内存还是有一点泄漏,需要检查修复,以及内存释放的问题,包括QListQPair +基类析构函数设计为virtual,解放node的desc 右键菜单的QAction会造成内存泄漏 目前已知的内存泄漏存在于没完成的deleteItem 删除节点时同时删除相关连线,优化或重写deleteItem算法 diff --git a/src/src.pro b/src/src.pro index 7466db8..90ad023 100644 --- a/src/src.pro +++ b/src/src.pro @@ -62,3 +62,7 @@ else: unix:!android: target.path = /opt/$${TARGET}/bin DISTFILES += \ ../README.md \ ../reply/nodestyle.qss + + +# QMAKE_CXXFLAGS += -Wno-unused-parameter +# QMAKE_CXXFLAGS += -Wno-unused-variable diff --git a/src/vapour_action_cv.h b/src/vapour_action_cv.h index c39ae29..01bb046 100644 --- a/src/vapour_action_cv.h +++ b/src/vapour_action_cv.h @@ -9,6 +9,7 @@ class VapourActionCvShow : public VapourAction public: VapourActionCvShow(cv::Mat m,int n=1){ Q_UNUSED(n); + Q_UNUSED(m); QLineEdit* edit1 = new QLineEdit("1",this); edit1->setAlignment(Qt::AlignLeft); edit1->setGeometry(0,0,150,25); @@ -56,6 +57,7 @@ class VapourActionCvInput : public VapourAction public: VapourActionCvInput(cv::Mat m,int n=1){ Q_UNUSED(n); + Q_UNUSED(m); QLineEdit* edit = new QLineEdit("C:\\Users\\Cuimi\\Desktop\\1.png",this); edit->setAlignment(Qt::AlignLeft); edit->setGeometry(0,0,150,25); diff --git a/src/vapour_data.h b/src/vapour_data.h index f3dfffd..3812fdf 100644 --- a/src/vapour_data.h +++ b/src/vapour_data.h @@ -1,17 +1,34 @@ #ifndef VAPOURDATA_H #define VAPOURDATA_H +#include #include"vapour_types.h" +#include +#include +#include +#include class VapourData { public: - VapourData(){} - + VapourData(){ + this->data_type = VapourDataTypeBasic; + } + virtual ~VapourData(){} VapourDataType dataType(){ return this->data_type; } + + virtual void setData(double data){ + qDebug()<data = 0; + } + ~VapourDataDouble(){} + void setData(double data) override{ + this->data = data; + } + double getDoubleData() override{ + return this->data; } @@ -29,4 +53,23 @@ class VapourDataDouble : public VapourData double data; }; +class VapourDataMat : public VapourData +{ +public: + VapourDataMat():VapourData(){ + VapourData::data_type = VapourDataTypeMat; + } + ~VapourDataMat(){} + void setData(cv::Mat data) override{ + this->data = data; + } + cv::Mat getMatData() override{ + return this->data; + } + +public: + cv::Mat data; + +}; + #endif // VAPOURDATA_H diff --git a/src/vapour_demo.cpp b/src/vapour_demo.cpp index df36533..fba4ddb 100644 --- a/src/vapour_demo.cpp +++ b/src/vapour_demo.cpp @@ -1,6 +1,8 @@ #include #include #include"vapour_win.h" +#include"vapour_types.h" +#include"vapour_data.h" #include #include #include @@ -68,6 +70,7 @@ int main(int argc, char *argv[]) + return a.exec(); } diff --git a/src/vapour_descriptor.h b/src/vapour_descriptor.h index 8f88e1e..7134d9d 100644 --- a/src/vapour_descriptor.h +++ b/src/vapour_descriptor.h @@ -77,13 +77,13 @@ class VapourDescriptor : public QGraphicsItem return this->interaction->edits[n]->text().toDouble(); } virtual QString getFile(){ - // return this->interaction->edits[0]->text(); + return {}; } virtual void test_T_image(cv::Mat m){ - + Q_UNUSED(m); } virtual QList getParams(){ - + return {}; } diff --git a/src/vapour_node.cpp b/src/vapour_node.cpp index 71ee8f4..530a35c 100644 --- a/src/vapour_node.cpp +++ b/src/vapour_node.cpp @@ -7,8 +7,10 @@ VapourNode::VapourNode(QWidget *parent) // qDebug()<<"Create: Basic Vapour-node"; initDesc(1,1); this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"test",1); + setTitle("nothing here"); } + VapourNode::VapourNode(const VapourNode &node, QWidget *parent) :QWidget(parent) { @@ -25,9 +27,13 @@ VapourNode::~VapourNode() qDebug()<<"Delete: VapourNode"; qDeleteAll(input_nodes); qDeleteAll(output_nodes); + qDeleteAll(input_datas); + qDeleteAll(output_datas); // delete connect_info delete desc; input_nodes.clear(); output_nodes.clear(); + input_datas.clear(); + output_datas.clear(); desc = nullptr; } diff --git a/src/vapour_node.h b/src/vapour_node.h index e13f60e..4a6025d 100644 --- a/src/vapour_node.h +++ b/src/vapour_node.h @@ -8,9 +8,9 @@ #include #include #include"vapour_types.h" -#include"vapour_descriptor.h" #include"vapour_action_develop.h" #include"vapour_descriptor_develop.h" +#include"vapour_data.h" // 释放 connect_info 内存 class VapourNode : public QWidget @@ -41,25 +41,9 @@ class VapourNode : public QWidget virtual VapourDescriptor* getDesc(){ return this->desc; } - virtual void initData(){ - } - virtual void handle(){ - } - virtual QList getInputDatas(){ - - } - virtual QList getOutputDatas(){ - - } - virtual void setInputDatas(int n,DMat m){ - - } - virtual void setOutputDatas(int n,DMat m){ - - } - virtual void transfer(){ - qDebug()<<"basic transfer"; - } + virtual void initData(){} + virtual void handle(){} + virtual void transfer(){} public: @@ -69,10 +53,10 @@ class VapourNode : public QWidget QList,QPair>> connect_info; QList input_nodes; QList output_nodes; - // input_Data - // output_Data - QList input_datas; - QList output_datas; + + QList input_datas; + QList output_datas; + int input_vaild = 0; int output_vaild = 0; diff --git a/src/vapour_node_cv.h b/src/vapour_node_cv.h index 8f5abcc..26bde93 100644 --- a/src/vapour_node_cv.h +++ b/src/vapour_node_cv.h @@ -16,49 +16,36 @@ class VapourNodeCvInput : public VapourNode this->desc->setTitle("CV-test"); this->desc->setDescWidth(300); this->desc->setDescHeight(180); + this->setTitle("ImageInput"); } void initData() override{ qDebug()<<"initData"; - //qDeleteAll(input_datas); + qDeleteAll(input_datas); input_datas.clear(); - //qDeleteAll(output_datas); + 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; + input_datas.append(new VapourDataMat); + input_datas[i]->setData(m); } for(int i=0;idesc->output_sockets.length();i++){ - output_datas.append({m}); + output_datas.append(new VapourDataMat); } } void handle() override{ - output_datas[0].data = input_datas[0].data; - + output_datas[0]->setData(input_datas[0]->getMatData()); } 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]); + this->connect_info[i].first.second->input_datas[this->connect_info[i].second.second]->setData( + this->connect_info[i].first.first->output_datas[0]->getMatData()); + cv::imshow("a",output_datas[0]->getMatData()); } - cv::imshow("a",output_datas[0].data); - } - QList getInputDatas() override{ - return this->input_datas; - } - QList getOutputDatas() override{ - return this->output_datas; + cv::imshow("a",output_datas[0]->getMatData()); } - 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 @@ -73,36 +60,34 @@ class VapourNodeCvAdd : public VapourNode this->desc->setTitle("CV-test"); this->desc->setDescWidth(300); this->desc->setDescHeight(180); + this->setTitle("ImageAdd"); } void initData() override{ qDebug()<<"initData"; - //qDeleteAll(input_datas); + qDeleteAll(input_datas); input_datas.clear(); - //qDeleteAll(output_datas); + qDeleteAll(output_datas); output_datas.clear(); cv::Mat m; for(int i=0;idesc->input_sockets.length();i++){ - input_datas.append({m}); + input_datas.append(new VapourDataMat); } for(int i=0;idesc->output_sockets.length();i++){ - output_datas.append({m}); + output_datas.append(new VapourDataMat); } } 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()< im = input_datas[0]->getMatData(); + cv::Mat_ im2 = input_datas[1]->getMatData(); + qDebug()<getMatData().rows<getMatData().cols; + qDebug()<getMatData().rows<getMatData().cols; for (int i = x; i < y; i++) { for (int j = w; j < h; j++) { im(i, j)[0] = im2(i, j)[0]; @@ -110,88 +95,19 @@ class VapourNodeCvAdd : public VapourNode im(i, j)[2] = im2(i, j)[2]; } } - output_datas[0].data = im; + output_datas[0]->setData(im); } 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 VapourNodeCvLoad : public VapourNode -{ -public: - VapourNodeCvLoad(QWidget *parent=nullptr):VapourNode(parent){ - qDebug()<<"Create: Vapour CV-Input"; - initDesc(2,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(2, 2, CV_8UC3, cv::Scalar(0, 0, 255)); - for(int i=0;idesc->input_sockets.length();i++){ - input_datas.append({m}); - input_datas[i].data = this->desc->interaction->edits[i]->text().toDouble(); - } - for(int i=0;idesc->output_sockets.length();i++){ - output_datas.append({m}); - } - } - void handle() override{ - qDebug()<<"handle"<desc->interaction->edits[i]->setText(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]; - } + this->connect_info[i].first.second->input_datas[this->connect_info[i].second.second]->setData( + this->connect_info[i].first.first->output_datas[0]->getMatData()); + } + cv::imshow("a",output_datas[0]->getMatData()); } -public: - //VapourDescriptor* desc; - QList input_datas; - QList output_datas; }; - #endif // VAPOUR_NODE_CV_H diff --git a/src/vapour_node_develop.h b/src/vapour_node_develop.h index ad79ce0..e524719 100644 --- a/src/vapour_node_develop.h +++ b/src/vapour_node_develop.h @@ -8,39 +8,206 @@ class VapourNodeInput : public VapourNode public: VapourNodeInput(QWidget *parent=nullptr):VapourNode(parent){ qDebug()<<"Create: Vapour node-Input"; - initDesc(2,2); + initDesc(1,1); // 定义节点描述,自动定义节点用户接口 - this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"Input",2); + this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"Input",1); // 节点大小 - this->desc->setDescWidth(160); - this->desc->setDescHeight(120); + this->desc->setDescWidth(130); + this->desc->setDescHeight(80); + this->setTitle("DoubleInput"); } void initData() override{ - //qDeleteAll(input_datas); + qDeleteAll(input_datas); input_datas.clear(); - //qDeleteAll(output_datas); + 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;igetDesc()->input_sockets.length();i++){ + input_datas.append(new VapourDataDouble()); + input_datas[i]->setData(this->getDesc()->getText(i)); } - for(int i=0;idesc->output_sockets.length();i++){ - output_datas.append({0}); + for(int i=0;igetDesc()->output_sockets.length();i++){ + output_datas.append(new VapourDataDouble()); } } void handle() override{ output_datas[0] = input_datas[0]; - output_datas[1] = input_datas[1]; for(int i=0;idesc->setText(i,QString::number(this->input_datas[i].data)); + this->desc->setText(i,QString::number(this->input_datas[i]->getDoubleData())); } } 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 VapourNodeAdd : public VapourNode +{ +public: + VapourNodeAdd(QWidget *parent=nullptr):VapourNode(parent){ + qDebug()<<"Create: Vapour node-Input"; + initDesc(2,1); + // 定义节点描述,自动定义节点用户接口 + this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"Input",2); + // 节点大小 + this->desc->setDescWidth(160); + this->desc->setDescHeight(120); + this->setTitle("DoubleAdd"); + } + void initData() override{ + qDeleteAll(input_datas); + input_datas.clear(); + qDeleteAll(output_datas); + output_datas.clear(); + + for(int i=0;igetDesc()->input_sockets.length();i++){ + input_datas.append(new VapourDataDouble()); + input_datas[i]->setData(this->getDesc()->getText(i)); + } + for(int i=0;igetDesc()->output_sockets.length();i++){ + output_datas.append(new VapourDataDouble()); + } + } + void handle() override{ + output_datas[0]->setData(input_datas[0]->getDoubleData() + input_datas[1]->getDoubleData()); + for(int i=0;idesc->setText(i,QString::number(this->input_datas[i]->getDoubleData())); + } + } + void transfer() override{ + for(int i=0;ioutput_nodes.length();i++){ + 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 VapourNodeSub : public VapourNode +{ +public: + VapourNodeSub(QWidget *parent=nullptr):VapourNode(parent){ + qDebug()<<"Create: Vapour node-Input"; + initDesc(2,1); + // 定义节点描述,自动定义节点用户接口 + this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"Input",2); + // 节点大小 + this->desc->setDescWidth(160); + this->desc->setDescHeight(120); + this->setTitle("DoubleSub"); + } + void initData() override{ + qDeleteAll(input_datas); + input_datas.clear(); + qDeleteAll(output_datas); + output_datas.clear(); + + for(int i=0;igetDesc()->input_sockets.length();i++){ + input_datas.append(new VapourDataDouble()); + input_datas[i]->setData(this->getDesc()->getText(i)); + } + for(int i=0;igetDesc()->output_sockets.length();i++){ + output_datas.append(new VapourDataDouble()); + } + } + void handle() override{ + output_datas[0]->setData(input_datas[0]->getDoubleData() - input_datas[1]->getDoubleData()); + for(int i=0;idesc->setText(i,QString::number(this->input_datas[i]->getDoubleData())); + } + } + void transfer() override{ + for(int i=0;ioutput_nodes.length();i++){ + 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 VapourNodeMul : public VapourNode +{ +public: + VapourNodeMul(QWidget *parent=nullptr):VapourNode(parent){ + qDebug()<<"Create: Vapour node-Input"; + initDesc(2,1); + // 定义节点描述,自动定义节点用户接口 + this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"Input",2); + // 节点大小 + this->desc->setDescWidth(160); + this->desc->setDescHeight(120); + this->setTitle("DoubleMul"); + } + void initData() override{ + qDeleteAll(input_datas); + input_datas.clear(); + qDeleteAll(output_datas); + output_datas.clear(); + + for(int i=0;igetDesc()->input_sockets.length();i++){ + input_datas.append(new VapourDataDouble()); + input_datas[i]->setData(this->getDesc()->getText(i)); + } + for(int i=0;igetDesc()->output_sockets.length();i++){ + output_datas.append(new VapourDataDouble()); + } + } + void handle() override{ + output_datas[0]->setData(input_datas[0]->getDoubleData() * input_datas[1]->getDoubleData()); + for(int i=0;idesc->setText(i,QString::number(this->input_datas[i]->getDoubleData())); + } + } + void transfer() override{ + for(int i=0;ioutput_nodes.length();i++){ + 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 VapourNodeDiv : public VapourNode +{ +public: + VapourNodeDiv(QWidget *parent=nullptr):VapourNode(parent){ + qDebug()<<"Create: Vapour node-Input"; + initDesc(2,1); + // 定义节点描述,自动定义节点用户接口 + this->desc = new VapourDescriptorInput(input_socket_number,output_socket_number,"Input",2); + // 节点大小 + this->desc->setDescWidth(160); + this->desc->setDescHeight(120); + this->setTitle("DoubleDiv"); + } + void initData() override{ + qDeleteAll(input_datas); + input_datas.clear(); + qDeleteAll(output_datas); + output_datas.clear(); + + for(int i=0;igetDesc()->input_sockets.length();i++){ + input_datas.append(new VapourDataDouble()); + input_datas[i]->setData(this->getDesc()->getText(i)); + } + for(int i=0;igetDesc()->output_sockets.length();i++){ + output_datas.append(new VapourDataDouble()); + } + } + void handle() override{ + output_datas[0]->setData(input_datas[0]->getDoubleData() / input_datas[1]->getDoubleData()); + for(int i=0;idesc->setText(i,QString::number(this->input_datas[i]->getDoubleData())); + } + } + void transfer() override{ + for(int i=0;ioutput_nodes.length();i++){ 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]; } @@ -59,33 +226,30 @@ class VapourNodeOutput : public VapourNode // 节点大小 this->desc->setDescWidth(200); this->desc->setDescHeight(80); + this->setTitle("DoubleOutput"); } void initData() override{ - //qDeleteAll(input_datas); + qDeleteAll(input_datas); input_datas.clear(); - //qDeleteAll(output_datas); + 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;igetDesc()->input_sockets.length();i++){ + input_datas.append(new VapourDataDouble()); } - for(int i=0;idesc->output_sockets.length();i++){ - output_datas.append({0}); + for(int i=0;igetDesc()->output_sockets.length();i++){ + output_datas.append(new VapourDataDouble()); } } virtual void handle() override{ - // show number for(int i=0;idesc->setText(i,QString::number(this->input_datas[i].data)); + this->desc->setText(i,QString::number(this->input_datas[i]->getDoubleData())); } } 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_types.h b/src/vapour_types.h index 6cada67..3d6b5c4 100644 --- a/src/vapour_types.h +++ b/src/vapour_types.h @@ -23,8 +23,10 @@ enum VapourSocketDataType{ enum VapourDataType{ + VapourDataTypeBasic = -1, VapourDataTypeDouble = 0, VapourDataTypeString = 1, + VapourDataTypeMat = 2, }; struct Connect{ diff --git a/src/vapour_view.cpp b/src/vapour_view.cpp index 37ced0a..3962f32 100644 --- a/src/vapour_view.cpp +++ b/src/vapour_view.cpp @@ -359,24 +359,44 @@ void VapourView::addNode(int index, int type, QPoint pos) } else if(type==1){ node = new VapourNodeOutput(); + node->getDesc()->setDescWidth(150); } else if(type==2){ - node = new VapourNodeCvInput(); - node->desc->setDescHeight(100); + node = new VapourNodeAdd(); + node->getDesc()->setDescWidth(200); } else if(type==3){ + node = new VapourNodeSub(); + node->getDesc()->setDescWidth(200); + } + else if(type==4){ + node = new VapourNodeMul(); + node->getDesc()->setDescWidth(200); + } + else if(type==5){ + node = new VapourNodeDiv(); + node->getDesc()->setDescWidth(200); + } + + else if(type==10){ + node = new VapourNodeCvInput(); + node->getDesc()->setDescWidth(200); + node->getDesc()->setDescHeight(100); + } + else if(type==11){ node = new VapourNodeCvAdd(); + node->getDesc()->setDescWidth(200); + node->getDesc()->setDescHeight(200); } else{ node = new VapourNodeInput(); } - node->desc->setDescWidth(200); posF.setX(posF.x()-40); posF.setY(posF.y()-40); node->setPos(posF); node->setIndex(index); - node->setTitle(QString::number(index)); + // node->setTitle(QString::number(index)); this->nodes.push_back(node); this->vapour_scene->addItem(node->desc); } @@ -639,41 +659,56 @@ void VapourView::contextMenuEvent(QContextMenuEvent *event) qDeleteAll(action); action.clear(); - action.append(menu->addAction("Shader-Input")); + action.append(menu->addAction("DoubleInput")); connect(action[0], &QAction::triggered, [=]() { addNode(number++,0,pos); }); - action.append(menu->addAction("Number-Output")); + action.append(menu->addAction("DoubleOutput")); connect(action[1], &QAction::triggered, [=]() { addNode(number++,1,pos); }); - menu->addSeparator(); - action.append(menu->addAction("Cv-Load")); + action.append(menu->addAction("DoubleAdd")); connect(action[2], &QAction::triggered, [=]() { addNode(number++,2,pos); }); - action.append(menu->addAction("Cv-Add")); + action.append(menu->addAction("DoubleSub")); connect(action[3], &QAction::triggered, [=]() { addNode(number++,3,pos); }); - action.append(menu->addAction("Number-Mul")); + action.append(menu->addAction("DoubleMul")); connect(action[4], &QAction::triggered, [=]() { - //addNode(number++,4,pos); + addNode(number++,4,pos); }); - action.append(menu->addAction("Number-Div")); + action.append(menu->addAction("DoubleDiv")); connect(action[5], &QAction::triggered, [=]() { - //addNode(number++,5,pos); + addNode(number++,5,pos); }); + menu->addSeparator(); + + + action.append(menu->addAction("ImageLoad")); + connect(action[6], &QAction::triggered, [=]() + { + addNode(number++,10,pos); + }); + action.append(menu->addAction("ImageBitwiseAnd")); + connect(action[7], &QAction::triggered, [=]() + { + addNode(number++,11,pos); + }); + + QMenu *funcMenu = new QMenu("Func"); QAction *addNoden = funcMenu->addAction("JustAShow"); Q_UNUSED(addNoden); + // //addNoden->setMenu(childMenu); funcMenu->setStyleSheet(qss); menu->addMenu(funcMenu);