Go to the documentation of this file.00001 #include <pcl/apps/cloud_composer/items/fpfh_item.h>
00002 #include <pcl/apps/cloud_composer/qt.h>
00003 #include <vtkRenderWindow.h>
00004
00005 pcl::cloud_composer::FPFHItem::FPFHItem (QString name, pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfh_ptr, double radius)
00006 : CloudComposerItem (name)
00007 , fpfh_ptr_ (fpfh_ptr)
00008 , radius_ (radius)
00009
00010 {
00011 pcl::PointCloud<pcl::FPFHSignature33>::ConstPtr fpfh_const = fpfh_ptr;
00012 this->setData (QVariant::fromValue (fpfh_const), ItemDataRole::CLOUD_TEMPLATED);
00013 properties_->addCategory ("Core Properties");
00014 properties_->addProperty ("Radius", QVariant (radius_), Qt::ItemIsEnabled, "Core Properties");
00015
00016
00017 }
00018
00019 pcl::cloud_composer::FPFHItem*
00020
00021 pcl::cloud_composer::FPFHItem::clone () const
00022 {
00023 pcl::PointCloud<pcl::FPFHSignature33>::Ptr fpfh_copy (new pcl::PointCloud<pcl::FPFHSignature33> (*fpfh_ptr_));
00024 FPFHItem* new_item = new FPFHItem (this->text (), fpfh_copy, radius_);
00025
00026 PropertiesModel* new_item_properties = new_item->getPropertiesModel ();
00027 new_item_properties->copyProperties (properties_);
00028
00029 return new_item;
00030 }
00031
00032 pcl::cloud_composer::FPFHItem::~FPFHItem ()
00033 {
00034
00035 }
00036
00037 QMap <QString, QWidget*>
00038 pcl::cloud_composer::FPFHItem::getInspectorTabs ()
00039 {
00040
00041
00042
00043 if (!plot_)
00044 {
00045 plot_ = boost::shared_ptr<pcl::visualization::PCLPlotter> (new pcl::visualization::PCLPlotter);
00046 qvtk_ = new QVTKWidget ();
00047 hist_page_ = new QWidget ();
00048 QGridLayout *mainLayout = new QGridLayout (hist_page_);
00049 mainLayout-> addWidget (qvtk_,0,0);
00050 }
00051
00052
00053 plot_->addFeatureHistogram (*fpfh_ptr_, fpfh_ptr_->width, data(ItemDataRole::ITEM_ID).toString().toStdString ());
00054
00055 plot_->setViewInteractor (vtkSmartPointer<vtkRenderWindowInteractor> (qvtk_->GetInteractor ()));
00056 qvtk_->SetRenderWindow (plot_->getRenderWindow ());
00057 qvtk_->show ();
00058 qvtk_->update ();
00059
00060 QMap <QString, QWidget*> tabs;
00061 tabs.insert ("Histogram",hist_page_);
00062 return tabs;
00063 }
00064
00065