Line 27... |
Line 27... |
27 |
qRegisterMetaType< std::vector<SMCalibrationSet> >("std::vector<SMCalibrationSet>");
|
27 |
qRegisterMetaType< std::vector<SMCalibrationSet> >("std::vector<SMCalibrationSet>");
|
28 |
qRegisterMetaType<SMFrameSequence>("SMFrameSequence");
|
28 |
qRegisterMetaType<SMFrameSequence>("SMFrameSequence");
|
29 |
qRegisterMetaType< std::vector<SMFrameSequence> >("std::vector<SMFrameSequence>");
|
29 |
qRegisterMetaType< std::vector<SMFrameSequence> >("std::vector<SMFrameSequence>");
|
30 |
qRegisterMetaType<pcl::PointCloud<pcl::PointXYZRGB>::Ptr>("pcl::PointCloud<pcl::PointXYZRGB>::Ptr");
|
30 |
qRegisterMetaType<pcl::PointCloud<pcl::PointXYZRGB>::Ptr>("pcl::PointCloud<pcl::PointXYZRGB>::Ptr");
|
31 |
qRegisterMetaType<SMPointCloud>("SMPointCloud");
|
31 |
qRegisterMetaType<SMPointCloud>("SMPointCloud");
|
- |
|
32 |
qRegisterMetaType< std::vector<SMPointCloud> >("std::vector<SMPointCloud>");
|
32 |
|
33 |
|
33 |
// Setup ui (requires stream operators registered)
|
34 |
// Setup ui (requires stream operators registered)
|
34 |
ui->setupUi(this);
|
35 |
ui->setupUi(this);
|
35 |
|
36 |
|
36 |
// Restore geometry
|
37 |
// Restore geometry
|
Line 584... |
Line 585... |
584 |
// now done before QMetaObject::invokeMethod(reconstructionWorker, "reconstructPointCloud", Q_ARG(SMFrameSequence, captureData[i]));
|
585 |
// now done before QMetaObject::invokeMethod(reconstructionWorker, "reconstructPointCloud", Q_ARG(SMFrameSequence, captureData[i]));
|
585 |
}
|
586 |
}
|
586 |
}
|
587 |
}
|
587 |
}
|
588 |
}
|
588 |
|
589 |
|
- |
|
590 |
void SMScanner::on_meshButton_clicked(){
|
- |
|
591 |
|
- |
|
592 |
// Set up reconstruction thread
|
- |
|
593 |
meshWorker = new SMMeshingWorker;
|
- |
|
594 |
meshWorkerThread = new QThread(this);
|
- |
|
595 |
meshWorkerThread->setObjectName("meshWorkerThread");
|
- |
|
596 |
meshWorker->moveToThread(meshWorkerThread);
|
- |
|
597 |
meshWorkerThread->start();
|
- |
|
598 |
|
- |
|
599 |
// Connections
|
- |
|
600 |
//connect(meshWorker, SIGNAL(newMesh(pcl::PolygonMesh)), this, SLOT(onReceiveMesh(pcl::PolygonMesh)));
|
- |
|
601 |
//connect(meshWorker, SIGNAL(done()), meshWorkerThread, SLOT(quit()));
|
- |
|
602 |
//connect(meshWorker, SIGNAL(done()), meshWorker, SLOT(deleteLater()));
|
- |
|
603 |
|
- |
|
604 |
// Start reconstructing
|
- |
|
605 |
//QMetaObject::invokeMethod(meshWorker, "setup");
|
- |
|
606 |
|
- |
|
607 |
// TODO is a reference working here??
|
- |
|
608 |
QMetaObject::invokeMethod(meshWorker, "reconstructMesh",
|
- |
|
609 |
Q_ARG(std::vector<SMPointCloud>, pointCloudData));
|
- |
|
610 |
}
|
- |
|
611 |
|
589 |
void SMScanner::onReceivePointCloud(SMPointCloud smCloud){
|
612 |
void SMScanner::onReceivePointCloud(SMPointCloud smCloud){
|
590 |
// for(int i=0; i<captureData.size(); i++){
|
613 |
// for(int i=0; i<captureData.size(); i++){
|
591 |
// if(captureData[i].id == id)
|
614 |
// if(captureData[i].id == id)
|
592 |
// captureData[i].reconstructed = true;
|
615 |
// captureData[i].reconstructed = true;
|
593 |
// }
|
616 |
// }
|
594 |
|
617 |
|
595 |
//pointCloudData.push_back(smCloud);
|
618 |
//pointCloudData.push_back(smCloud);
|
- |
|
619 |
// TODO on demand resizing here is evil
|
596 |
if(pointCloudData.size()<=smCloud.id) pointCloudData.resize(smCloud.id+1);
|
620 |
if(pointCloudData.size()<=smCloud.id) pointCloudData.resize(smCloud.id+1);
|
597 |
pointCloudData[smCloud.id] = smCloud;
|
621 |
pointCloudData[smCloud.id] = smCloud;
|
598 |
|
622 |
|
599 |
// Add identifier to list
|
623 |
// Add identifier to list
|
600 |
QListWidgetItem* item = new QListWidgetItem(QString("Point Cloud %1 -- %2 deg").arg(smCloud.id).arg(smCloud.rotationAngle));
|
624 |
QListWidgetItem* item = new QListWidgetItem(QString("Point Cloud %1 -- %2 deg").arg(smCloud.id).arg(smCloud.rotationAngle));
|
Line 602... |
Line 626... |
602 |
item->setData(Qt::UserRole, QVariant(smCloud.id));
|
626 |
item->setData(Qt::UserRole, QVariant(smCloud.id));
|
603 |
item->setCheckState(Qt::Checked);
|
627 |
item->setCheckState(Qt::Checked);
|
604 |
|
628 |
|
605 |
ui->pointCloudsListWidget->addItem(item);
|
629 |
ui->pointCloudsListWidget->addItem(item);
|
606 |
ui->pointCloudWidget->addPointCloud(smCloud, smCloud.id);
|
630 |
ui->pointCloudWidget->addPointCloud(smCloud, smCloud.id);
|
- |
|
631 |
|
- |
|
632 |
// TODO just to test
|
- |
|
633 |
on_meshButton_clicked();
|
607 |
}
|
634 |
}
|
608 |
|
635 |
|
609 |
void SMScanner::on_actionExport_Point_Clouds_triggered(){
|
636 |
void SMScanner::on_actionExport_Point_Clouds_triggered(){
|
610 |
|
637 |
|
611 |
QString directory = QFileDialog::getExistingDirectory(this, "Export Point Clouds", QString());
|
638 |
QString directory = QFileDialog::getExistingDirectory(this, "Export Point Clouds", QString());
|