void MainWindow::cloud_callback(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr& cloud) { boost::mutex::scoped_lock lock(mutex); buffer = cloud; Q_EMIT cloudUpdate(); }
Cabin::Cabin(AudioControl &_audio) { audio = &_audio; toon.load("shader/toon.vert", "shader/toon.frag"); seatbeltOn.loadImage("image/seatbelt_on.png"); seatbeltOff.loadImage("image/seatbelt_off.png"); seatbelt = &seatbeltOn; windows.allocate(500,500,GL_RGBA); windowMask.loadImage("image/windowmask.png"); cloudImg.loadImage("image/cloud.png"); for(int i=0;i<NUMCLOUDS;i++) { clouds.push_back( new ofVec3f( ofRandom(windows.getWidth()), ofRandom(windows.getHeight()), ofRandom(maxCloudScale) ) ); } cloudUpdate(); seatbelt = &seatbeltOff; audio->trigger(ENGINE); }
boost::shared_ptr<PointCloud> CloudList::addCloud(boost::shared_ptr<PointCloud> pc) { mtx_->lock(); beginInsertRows(QModelIndex(), clouds_.size(), clouds_.size()); clouds_.push_back(pc); if(active_.get() == nullptr) active_ = pc; endInsertRows(); mtx_->unlock(); //connect(pc.get(), SIGNAL(flagUpdate()), this, SIGNAL(updated())); //connect(pc.get(), SIGNAL(labelUpdate()), this, SIGNAL(updated())); connect(pc.get(), SIGNAL(transformed()), this, SIGNAL(updated())); emit cloudUpdate(pc); return pc; }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), currentFileName(QString()) { ui->setupUi(this); kinectGrabber = new pcl::KinectGrabber(); // Initialize kinect grabber kinectGrabber->start(); // Start Retrieve Data boost::function<void(const pcl::PointCloud<pcl::PointXYZRGB>::ConstPtr&) > callback = boost::bind(&MainWindow::cloud_callback, this, _1); boost::signals2::connection connection = kinectGrabber->registerCallback(callback); // Set up the QVTK window viewer.reset(new pcl::visualization::PCLVisualizer("viewer", false)); ui->qvtkWidget->SetRenderWindow(viewer->getRenderWindow()); viewer->setupInteractor(ui->qvtkWidget->GetInteractor(), ui->qvtkWidget->GetRenderWindow()); ui->qvtkWidget->update(); connect(this, SIGNAL(cloudUpdate()), this, SLOT(update())); }
void Cabin::update() { cloudUpdate(); }