60 lines
1.6 KiB
C++
60 lines
1.6 KiB
C++
|
|
#include "Child3dFrom.h"
|
||
|
|
#include "ui_Child3dFrom.h"
|
||
|
|
#include "mylineplot3d.h"
|
||
|
|
#include <include/qwt3d_enrichment_std.h>
|
||
|
|
|
||
|
|
Child3DFrom::Child3DFrom(QWidget *parent) :
|
||
|
|
QWidget(parent),
|
||
|
|
ui(new Ui::Child3DFrom)
|
||
|
|
{
|
||
|
|
ui->setupUi(this);
|
||
|
|
connect(ui->ChannelBtn, SIGNAL(clicked()), this, SLOT(ChannelBtnSlot())); //打开通道选择
|
||
|
|
ui->ChannelWgt->setVisible(false);
|
||
|
|
ui->tableWidget->setColumnWidth(0, 180);
|
||
|
|
ui->tableWidget->setColumnWidth(1, 40);
|
||
|
|
|
||
|
|
myL3d = new mylineplot3d();
|
||
|
|
QVBoxLayout * qvl = new QVBoxLayout(ui->widget_4);
|
||
|
|
qvl->addWidget(myL3d);
|
||
|
|
this->setLayout(qvl);
|
||
|
|
myL3d->init();
|
||
|
|
myL3d->resize(800,600);
|
||
|
|
this->resize(800,600);
|
||
|
|
Qwt3D::Line3D l3d;
|
||
|
|
|
||
|
|
mypL3d_1 = dynamic_cast< Qwt3D::Line3D*>(myL3d->addEnrichment(l3d));
|
||
|
|
|
||
|
|
myL3d->init();
|
||
|
|
myL3d->coordinates()->setGridLines(true,true,Qwt3D::LEFT|Qwt3D::BACK|Qwt3D::FLOOR);
|
||
|
|
|
||
|
|
myL3d->setTitle(tr("瀑布图"));
|
||
|
|
|
||
|
|
mypL3d_1->configure(3,true);
|
||
|
|
|
||
|
|
mypL3d_1->setLineColor(Qwt3D::RGBA(0,0,1,1));
|
||
|
|
myL3d->setCurMaxMin(0,1000,0,20,0,60);
|
||
|
|
mypL3d_1->add(Qwt3D::Triple(x,y,z));
|
||
|
|
|
||
|
|
myL3d->tick();
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
Child3DFrom::~Child3DFrom()
|
||
|
|
{
|
||
|
|
delete ui;
|
||
|
|
}
|
||
|
|
void Child3DFrom::ChannelBtnSlot()
|
||
|
|
{
|
||
|
|
ui->ChannelWgt->setVisible(!ui->ChannelWgt->isVisible());
|
||
|
|
QString strStyle;
|
||
|
|
if(ui->ChannelWgt->isVisible())
|
||
|
|
{
|
||
|
|
strStyle = "#ChannelBtn{border-image:url(:/images/images/hideChannel.png);}";
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
strStyle = "#ChannelBtn{border-image:url(:/images/images/showChannel.png);}";
|
||
|
|
}
|
||
|
|
ui->ChannelBtn->setStyleSheet(strStyle);
|
||
|
|
}
|