41#pragma GCC system_header
45#include <pcl/pcl_base.h>
46#include <pcl/point_cloud.h>
47#include <pcl/common/io.h>
49#include <vtkSmartPointer.h>
51#include <vtkFloatArray.h>
55 namespace visualization
61 template <
typename Po
intT>
139 template <
typename Po
intT>
158 getName ()
const {
return (
"PointCloudGeometryHandlerXYZ"); }
187 template <
typename Po
intT>
203 getName ()
const {
return (
"PointCloudGeometryHandlerSurfaceNormal"); }
232 template <
typename Po
intT>
265 getName ()
const {
return (
"PointCloudGeometryHandlerCustom"); }
282 points->SetDataTypeToFloat ();
283 points->SetNumberOfPoints (
cloud_->size ());
291 const std::uint8_t*
pt_data =
reinterpret_cast<const std::uint8_t*
> (&(*cloud_)[i]);
301 points->SetPoint (i, p);
315 std::string field_name_;
338 , field_x_idx_ (UNAVAILABLE)
339 , field_y_idx_ (UNAVAILABLE)
340 , field_z_idx_ (UNAVAILABLE)
341 , fields_ (cloud_->fields)
422 getName ()
const {
return (
"PointCloudGeometryHandlerXYZ"); }
452 getName ()
const {
return (
"PointCloudGeometryHandlerSurfaceNormal"); }
485 getName ()
const {
return (
"PointCloudGeometryHandlerCustom"); }
493 std::string field_name_;
498#ifdef PCL_NO_PRECOMPILE
499#include <pcl/visualization/impl/point_cloud_geometry_handlers.hpp>
Iterator class for point clouds with or without given indices.
shared_ptr< PointCloud< PointT > > Ptr
shared_ptr< const PointCloud< PointT > > ConstPtr
virtual std::string getName() const =0
Abstract getName method.
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
shared_ptr< const PointCloudGeometryHandler< PointCloud > > ConstPtr
PointCloud::Ptr PointCloudPtr
PointCloudConstPtr cloud_
A pointer to the input dataset.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
bool isCapable() const
Check if this handler is capable of handling the input data or not.
index_t field_z_idx_
The index of the field holding the Z data.
virtual ~PointCloudGeometryHandler()
Destructor.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
PointCloud::ConstPtr PointCloudConstPtr
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
index_t field_y_idx_
The index of the field holding the Y data.
PointCloudGeometryHandler(const PointCloudConstPtr &cloud, const Eigen::Vector4f &=Eigen::Vector4f::Zero())
Constructor.
index_t field_x_idx_
The index of the field holding the X data.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
virtual std::string getName() const
Class getName method.
virtual ~PointCloudGeometryHandlerCustom()
Destructor.
virtual std::string getFieldName() const
Get the name of the field used.
PointCloud::Ptr PointCloudPtr
PointCloud::ConstPtr PointCloudConstPtr
PointCloudGeometryHandlerCustom(const PointCloudConstPtr &cloud, const std::string &x_field_name, const std::string &y_field_name, const std::string &z_field_name)
Constructor.
Custom handler class for PointCloud geometry.
virtual std::string getFieldName() const
Get the name of the field used.
typename PointCloudGeometryHandler< PointT >::PointCloud PointCloud
typename PointCloud::Ptr PointCloudPtr
virtual std::string getName() const
Class getName method.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
PointCloudGeometryHandlerCustom(const PointCloudConstPtr &cloud, const std::string &x_field_name, const std::string &y_field_name, const std::string &z_field_name)
Constructor.
typename PointCloud::ConstPtr PointCloudConstPtr
Base handler class for PointCloud geometry.
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
index_t field_y_idx_
The index of the field holding the Y data.
virtual std::string getName() const =0
Abstract getName method.
bool isCapable() const
Checl if this handler is capable of handling the input data or not.
index_t field_z_idx_
The index of the field holding the Z data.
virtual ~PointCloudGeometryHandler()
Destructor.
PointCloudGeometryHandler(const PointCloudConstPtr &cloud)
Constructor.
typename PointCloud::Ptr PointCloudPtr
bool capable_
True if this handler is capable of handling the input data, false otherwise.
typename PointCloud::ConstPtr PointCloudConstPtr
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
PointCloudConstPtr cloud_
A pointer to the input dataset.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const =0
Obtain the actual point geometry for the input dataset in VTK format.
index_t field_x_idx_
The index of the field holding the X data.
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudGeometryHandlerSurfaceNormal(const PointCloudConstPtr &cloud)
Constructor.
PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getName() const
Class getName method.
PointCloud::Ptr PointCloudPtr
Surface normal handler class for PointCloud geometry.
typename PointCloud::Ptr PointCloudPtr
typename PointCloudGeometryHandler< PointT >::PointCloud PointCloud
virtual std::string getFieldName() const
Get the name of the field used.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
PointCloudGeometryHandlerSurfaceNormal(const PointCloudConstPtr &cloud)
Constructor.
virtual std::string getName() const
Class getName method.
typename PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloud::ConstPtr PointCloudConstPtr
PointCloudGeometryHandlerXYZ(const PointCloudConstPtr &cloud)
Constructor.
virtual std::string getName() const
Class getName method.
PointCloud::Ptr PointCloudPtr
virtual ~PointCloudGeometryHandlerXYZ()
Destructor.
XYZ handler class for PointCloud geometry.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
virtual ~PointCloudGeometryHandlerXYZ()
Destructor.
typename PointCloud::Ptr PointCloudPtr
typename PointCloudGeometryHandler< PointT >::PointCloud PointCloud
PointCloudGeometryHandlerXYZ(const PointCloudConstPtr &cloud)
Constructor.
typename PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getName() const
Class getName method.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
static constexpr index_t UNAVAILABLE
A point structure representing Euclidean xyz coordinates, and the RGB color.