Point Cloud Library (PCL)
1.11.1
|
41 #pragma GCC system_header
45 #include <pcl/point_cloud.h>
46 #include <pcl/common/io.h>
48 #include <vtkSmartPointer.h>
49 #include <vtkPoints.h>
50 #include <vtkFloatArray.h>
54 namespace visualization
60 template <
typename Po
intT>
68 using Ptr = shared_ptr<PointCloudGeometryHandler<PointT> >;
69 using ConstPtr = shared_ptr<const PointCloudGeometryHandler<PointT> >;
138 template <
typename Po
intT>
146 using Ptr = shared_ptr<PointCloudGeometryHandlerXYZ<PointT> >;
147 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerXYZ<PointT> >;
157 getName ()
const {
return (
"PointCloudGeometryHandlerXYZ"); }
186 template <
typename Po
intT>
194 using Ptr = shared_ptr<PointCloudGeometryHandlerSurfaceNormal<PointT> >;
195 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerSurfaceNormal<PointT> >;
202 getName ()
const {
return (
"PointCloudGeometryHandlerSurfaceNormal"); }
231 template <
typename Po
intT>
239 using Ptr = shared_ptr<PointCloudGeometryHandlerCustom<PointT> >;
240 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerCustom<PointT> >;
244 const std::string &x_field_name,
245 const std::string &y_field_name,
246 const std::string &z_field_name)
258 field_name_ = x_field_name + y_field_name + z_field_name;
264 getName ()
const {
return (
"PointCloudGeometryHandlerCustom"); }
281 points->SetDataTypeToFloat ();
282 points->SetNumberOfPoints (
cloud_->size ());
287 for (vtkIdType i = 0; i < static_cast<vtkIdType> (
cloud_->size ()); ++i)
300 points->SetPoint (i, p);
314 std::string field_name_;
330 using Ptr = shared_ptr<PointCloudGeometryHandler<PointCloud> >;
331 using ConstPtr = shared_ptr<const PointCloudGeometryHandler<PointCloud> >;
340 , fields_ (cloud_->fields)
410 using Ptr = shared_ptr<PointCloudGeometryHandlerXYZ<PointCloud> >;
411 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerXYZ<PointCloud> >;
421 getName ()
const {
return (
"PointCloudGeometryHandlerXYZ"); }
443 using Ptr = shared_ptr<PointCloudGeometryHandlerSurfaceNormal<PointCloud> >;
444 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerSurfaceNormal<PointCloud> >;
451 getName ()
const {
return (
"PointCloudGeometryHandlerSurfaceNormal"); }
475 const std::string &x_field_name,
476 const std::string &y_field_name,
477 const std::string &z_field_name);
484 getName ()
const {
return (
"PointCloudGeometryHandlerCustom"); }
492 std::string field_name_;
497 #ifdef PCL_NO_PRECOMPILE
498 #include <pcl/visualization/impl/point_cloud_geometry_handlers.hpp>
static constexpr index_t UNAVAILABLE
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
PointCloudGeometryHandlerXYZ(const PointCloudConstPtr &cloud)
Constructor.
virtual std::string getName() const =0
Abstract getName method.
PointCloudGeometryHandlerCustom(const PointCloudConstPtr &cloud, const std::string &x_field_name, const std::string &y_field_name, const std::string &z_field_name)
Constructor.
virtual std::string getName() const
Class getName method.
virtual ~PointCloudGeometryHandlerCustom()
Destructor.
PointCloudGeometryHandler(const PointCloudConstPtr &cloud, const Eigen::Vector4f &=Eigen::Vector4f::Zero())
Constructor.
virtual std::string getName() const
Class getName method.
virtual std::string getName() const
Class getName method.
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudGeometryHandler()
Destructor.
PointCloudGeometryHandler(const PointCloudConstPtr &cloud)
Constructor.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
virtual std::string getName() const
Class getName method.
index_t field_z_idx_
The index of the field holding the Z data.
PointCloud represents the base class in PCL for storing collections of 3D points.
index_t field_z_idx_
The index of the field holding the Z data.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getName() const
Class getName method.
A point structure representing Euclidean xyz coordinates, and the RGB color.
shared_ptr< PointCloudGeometryHandler< PointT > > Ptr
Custom handler class for PointCloud geometry.
virtual ~PointCloudGeometryHandlerXYZ()
Destructor.
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudGeometryHandlerSurfaceNormal(const PointCloudConstPtr &cloud)
Constructor.
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
typename PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloud::ConstPtr PointCloudConstPtr
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
PointCloud::Ptr PointCloudPtr
PointCloudGeometryHandlerXYZ(const PointCloudConstPtr &cloud)
Constructor.
shared_ptr< PointCloudGeometryHandler< PointCloud > > Ptr
PointCloudGeometryHandlerCustom(const PointCloudConstPtr &cloud, const std::string &x_field_name, const std::string &y_field_name, const std::string &z_field_name)
Constructor.
shared_ptr< const PointCloudGeometryHandler< PointT > > ConstPtr
index_t field_y_idx_
The index of the field holding the Y data.
bool isCapable() const
Checl if this handler is capable of handling the input data or not.
virtual std::string getFieldName() const
Get the name of the field used.
shared_ptr< const PointCloudGeometryHandler< PointCloud > > ConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudConstPtr cloud_
A pointer to the input dataset.
shared_ptr< PointCloud< PointT > > Ptr
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
virtual ~PointCloudGeometryHandlerXYZ()
Destructor.
index_t field_x_idx_
The index of the field holding the X data.
PointCloudGeometryHandlerSurfaceNormal(const PointCloudConstPtr &cloud)
Constructor.
shared_ptr< const PointCloud< PointT > > ConstPtr
virtual ~PointCloudGeometryHandler()
Destructor.
typename PointCloud::Ptr PointCloudPtr
virtual std::string getName() const =0
Abstract getName method.
index_t field_x_idx_
The index of the field holding the X data.
index_t field_y_idx_
The index of the field holding the Y data.
Base handler class for PointCloud geometry.
bool isCapable() const
Check if this handler is capable of handling the input data or not.
XYZ handler class for PointCloud geometry.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
virtual std::string getName() const
Class getName method.
PointCloudConstPtr cloud_
A pointer to the input dataset.
Surface normal handler class for PointCloud geometry.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const =0
Obtain the actual point geometry for the input dataset in VTK format.