Subversion Repositories seema-scanner

Rev

Rev 42 | Rev 44 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42 Rev 43
Line 21... Line 21...
21
#include <vtkPolyDataWriter.h>
21
#include <vtkPolyDataWriter.h>
22
#include <pcl/conversions.h>
22
#include <pcl/conversions.h>
23
 
23
 
24
#include <fstream>
24
#include <fstream>
25
 
25
 
-
 
26
 
26
#include <QFileDialog>
27
#include <QFileDialog>
27
#include <QSettings>
28
#include <QSettings>
28
 
29
 
29
#include "SMCalibrationParameters.h"
30
#include "SMCalibrationParameters.h"
30
 
31
 
Line 48... Line 49...
48
 
49
 
49
    updateCalibrationParameters();
50
    updateCalibrationParameters();
50
    //time.start();
51
    //time.start();
51
}
52
}
52
 
53
 
53
void SMPointCloudWidget::addPointCloud(PointCloudPtr _pointCloudPCL){
54
void SMPointCloudWidget::addPointCloud(PointCloudPtr _pointCloudPCL, int id){
54
 
-
 
55
//    time.restart();
-
 
56
 
55
 
57
    pointCloudPCL = _pointCloudPCL;
56
    pointCloudPCL = _pointCloudPCL;
58
 
57
 
59
    // Note: using the color handler makes a copy of the rgb fields
58
    // Note: using the color handler makes a copy of the rgb fields
60
    colorHandler->setInputCloud(_pointCloudPCL);
59
    colorHandler->setInputCloud(_pointCloudPCL);
61
 
60
 
62
    visualizer->addPointCloud(pointCloudPCL, *colorHandler, "pointCloudPCL");
61
    visualizer->addPointCloud(pointCloudPCL, *colorHandler, QString::number(id).toStdString());
63
    visualizer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2.0, "pointCloudPCL");
62
    visualizer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2.0, QString::number(id).toStdString());
64
 
63
 
65
    this->update();
64
    this->update();
66
    emit newPointCloudDisplayed();
65
    emit newPointCloudDisplayed();
67
 
66
 
68
//    std::cout << "PCL Widget: " << time.restart() << "ms" << std::endl;
-
 
69
}
67
}
70
 
68
 
71
void SMPointCloudWidget::updatePointCloud(PointCloudPtr _pointCloudPCL){
69
void SMPointCloudWidget::updatePointCloud(PointCloudPtr _pointCloudPCL, int id){
72
 
-
 
73
//    time.restart();
-
 
74
 
70
 
75
    pointCloudPCL = _pointCloudPCL;
71
    pointCloudPCL = _pointCloudPCL;
76
 
72
 
77
    // Note: using the color handler makes a copy of the rgb fields
73
    // Note: using the color handler makes a copy of the rgb fields
78
    colorHandler->setInputCloud(_pointCloudPCL);
74
    colorHandler->setInputCloud(_pointCloudPCL);
79
 
75
 
80
    if(!visualizer->updatePointCloud(pointCloudPCL, *colorHandler, "pointCloudPCL")){
76
    if(!visualizer->updatePointCloud(pointCloudPCL, *colorHandler, QString::number(id).toStdString())){
81
        visualizer->addPointCloud(pointCloudPCL, *colorHandler, "pointCloudPCL");
77
        visualizer->addPointCloud(pointCloudPCL, *colorHandler, QString::number(id).toStdString());
82
        visualizer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2.0, "pointCloudPCL");
78
        visualizer->setPointCloudRenderingProperties(pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 2.0, QString::number(id).toStdString());
83
     }
79
     }
84
 
80
 
85
    this->update();
81
    this->update();
86
    emit newPointCloudDisplayed();
82
    emit newPointCloudDisplayed();
87
 
83
 
88
//    std::cout << "PCL Widget: " << time.restart() << "ms" << std::endl;
-
 
89
}
84
}
90
 
85
 
91
void SMPointCloudWidget::savePointCloud(){
86
void SMPointCloudWidget::savePointCloud(){
92
 
87
 
93
    QString selectedFilter;
88
    QString selectedFilter;