Point Cloud Library (PCL)
1.11.1-dev
|
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>
50 #include <vtkPoints.h>
51 #include <vtkFloatArray.h>
55 namespace visualization
61 template <
typename Po
intT>
69 using Ptr = shared_ptr<PointCloudGeometryHandler<PointT> >;
70 using ConstPtr = shared_ptr<const PointCloudGeometryHandler<PointT> >;
139 template <
typename Po
intT>
147 using Ptr = shared_ptr<PointCloudGeometryHandlerXYZ<PointT> >;
148 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerXYZ<PointT> >;
158 getName ()
const {
return (
"PointCloudGeometryHandlerXYZ"); }
187 template <
typename Po
intT>
195 using Ptr = shared_ptr<PointCloudGeometryHandlerSurfaceNormal<PointT> >;
196 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerSurfaceNormal<PointT> >;
203 getName ()
const {
return (
"PointCloudGeometryHandlerSurfaceNormal"); }
232 template <
typename Po
intT>
240 using Ptr = shared_ptr<PointCloudGeometryHandlerCustom<PointT> >;
241 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerCustom<PointT> >;
245 const std::string &x_field_name,
246 const std::string &y_field_name,
247 const std::string &z_field_name)
259 field_name_ = x_field_name + y_field_name + z_field_name;
265 getName ()
const {
return (
"PointCloudGeometryHandlerCustom"); }
282 points->SetDataTypeToFloat ();
283 points->SetNumberOfPoints (
cloud_->size ());
288 for (vtkIdType i = 0; i < static_cast<vtkIdType> (
cloud_->size ()); ++i)
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_;
331 using Ptr = shared_ptr<PointCloudGeometryHandler<PointCloud> >;
332 using ConstPtr = shared_ptr<const PointCloudGeometryHandler<PointCloud> >;
341 , fields_ (cloud_->fields)
350 getName ()
const = 0;
354 getFieldName ()
const = 0;
411 using Ptr = shared_ptr<PointCloudGeometryHandlerXYZ<PointCloud> >;
412 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerXYZ<PointCloud> >;
422 getName ()
const {
return (
"PointCloudGeometryHandlerXYZ"); }
444 using Ptr = shared_ptr<PointCloudGeometryHandlerSurfaceNormal<PointCloud> >;
445 using ConstPtr = shared_ptr<const PointCloudGeometryHandlerSurfaceNormal<PointCloud> >;
452 getName ()
const {
return (
"PointCloudGeometryHandlerSurfaceNormal"); }
476 const std::string &x_field_name,
477 const std::string &y_field_name,
478 const std::string &z_field_name);
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>
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 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 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.
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
shared_ptr< PointCloudGeometryHandler< PointCloud > > Ptr
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
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.