Пример #1
0
int Product::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    
#ifndef QT_NO_PROPERTIES
     if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = id(); break;
        case 1: *reinterpret_cast< QString*>(_v) = description(); break;
        case 2: *reinterpret_cast< QString*>(_v) = longdescription(); break;
        case 3: *reinterpret_cast< QString*>(_v) = longtext(); break;
        case 4: *reinterpret_cast< QString*>(_v) = image1(); break;
        case 5: *reinterpret_cast< QString*>(_v) = image2(); break;
        case 6: *reinterpret_cast< QString*>(_v) = image3(); break;
        case 7: *reinterpret_cast< QString*>(_v) = catid(); break;
        case 8: *reinterpret_cast< QString*>(_v) = subcatid(); break;
        }
        _id -= 9;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setId(*reinterpret_cast< QString*>(_v)); break;
        case 1: setDescription(*reinterpret_cast< QString*>(_v)); break;
        case 2: setLongDescription(*reinterpret_cast< QString*>(_v)); break;
        case 3: setLongText(*reinterpret_cast< QString*>(_v)); break;
        case 4: setImage1(*reinterpret_cast< QString*>(_v)); break;
        case 5: setImage2(*reinterpret_cast< QString*>(_v)); break;
        case 6: setImage2(*reinterpret_cast< QString*>(_v)); break;
        case 7: setCatId(*reinterpret_cast< QString*>(_v)); break;
        case 8: setSubCatId(*reinterpret_cast< QString*>(_v)); break;
        }
        _id -= 9;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 9;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 9;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 9)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 9;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Пример #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    scaleFactor(1.0),
    currentX(0),
    currentY(0),
    colorViewType(COLOR_RGB),
    currentCamera{-1,-1},
    workingDir(QDir::currentPath()),
    dmapSettingsModel(0, depthMapBuilder)
{
    ui->setupUi(this);

    scaleStatusLabel = new QLabel(this);
    coordsStatusLabel = new QLabel(this);

    ui->statusbar->addWidget(scaleStatusLabel);
    ui->statusbar->addWidget(coordsStatusLabel);

    ui->imageLabel1->installEventFilter(this);
    ui->imageLabel1->setMouseTracking(true);
    ui->imageLabel2->installEventFilter(this);
    ui->imageLabel2->setMouseTracking(true);
    ui->depthMapLabel->installEventFilter(this);

    resize(QGuiApplication::primaryScreen()->availableSize() * 3 / 5);
    updateActions();

    //initialze camera connections
    camera[0].setFrameCallback(std::bind(&FrameProcessor::setFrame, &frameProcessor[0], std::placeholders::_1));
    converter[0].setFrameSource(frameProcessor[0]);
    connect(&converter[0], SIGNAL(imageReady(QImage)), this, SLOT(setImage1(QImage)));

    camera[1].setFrameCallback(std::bind(&FrameProcessor::setFrame, &frameProcessor[1], std::placeholders::_1));
    converter[1].setFrameSource(frameProcessor[1]);
    connect(&converter[1], SIGNAL(imageReady(QImage)), this, SLOT(setImage2(QImage)));

    depthMapBuilder.setLeftSource(frameProcessor[0]);
    depthMapBuilder.setRightSource(frameProcessor[1]);
    converter[2].setFrameSource(depthMapBuilder);
    connect(&converter[2], SIGNAL(imageReady(QImage)), this, SLOT(setDepthImage(QImage)));

    converterThread[0].start();
    converter[0].moveToThread(&converterThread[0]);

    converterThread[1].start();
    converter[1].moveToThread(&converterThread[1]);

    converterThread[2].start();
    converter[2].moveToThread(&converterThread[2]);

    ui->depthSettingsTableView->setModel(&dmapSettingsModel);

    ui->actionCameraView->setChecked(true);
    this->converter[0].pause(false);
    this->converter[1].pause(false);
    this->converter[2].pause(true);
    depthMapBuilder.stopProcessing();

    ui->viewStackedWidget->setCurrentIndex(0);


    cloud.reset (new PointCloudT);
    viewer.reset (new pcl::visualization::PCLVisualizer ("viewer", false));
    viewer->setBackgroundColor (0.1, 0.1, 0.1);
    viewer->addCoordinateSystem (1.0);
    ui->pc3dVtk->SetRenderWindow (viewer->getRenderWindow ());
    viewer->setupInteractor (ui->pc3dVtk->GetInteractor (), ui->pc3dVtk->GetRenderWindow ());
    ui->pc3dVtk->update ();
    //viewer->addPointCloud (cloud, "cloud");
    //viewer->resetCamera ();
    //ui->pc3dVtk->update ();
}