void clearImage() { if(imageView){ Image image; image.clear(); image.setSize(1,1,3); *image.pixels() = 0; imageView->setImage(image); } if(pointSetFromRangeCamera){ pointSetFromRangeCamera->getOrCreateVertices()->clear(); pointSetFromRangeCamera->getOrCreateColors()->clear(); } if(pointSetFromRangeSensor){ pointSetFromRangeSensor->getOrCreateVertices()->clear(); pointSetFromRangeSensor->getOrCreateColors()->clear(); } }
void updatePointCloudFromRangeCamera() { if(!pointSetFromRangeCamera) return; SgVertexArray& disPoints = *pointSetFromRangeCamera->getOrCreateVertices(); SgColorArray& disColors = *pointSetFromRangeCamera->getOrCreateColors(); boost::mutex::scoped_lock lock(mtx); disPoints.resize(rangeCameraPoints.size()); disColors.resize(rangeCameraColors.size()); copy(rangeCameraPoints.begin(), rangeCameraPoints.end(), disPoints.begin()); copy(rangeCameraColors.begin(), rangeCameraColors.end(), disColors.begin()); lock.unlock(); pointSetFromRangeCamera->notifyUpdate(); }