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)
349 getName ()
const = 0;
353 getFieldName ()
const = 0;
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> std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
XYZ handler class for PointCloud geometry.
bool isCapable() const
Check if this handler is capable of handling the input data or not.
PointCloudGeometryHandlerXYZ(const PointCloudConstPtr &cloud)
Constructor.
PointCloudConstPtr cloud_
A pointer to the input dataset.
Custom handler class for PointCloud geometry.
static constexpr index_t UNAVAILABLE
shared_ptr< PointCloud< PointT > > Ptr
virtual std::string getName() const
Class getName method.
index_t field_y_idx_
The index of the field holding the Y data.
virtual std::string getFieldName() const
Get the name of the field used.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const =0
Obtain the actual point geometry for the input dataset in VTK format.
virtual std::string getName() const
Class getName method.
virtual std::string getFieldName() const
Get the name of the field used.
detail::int_type_t< detail::index_type_size, detail::index_type_signed > index_t
Type used for an index in PCL.
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
Surface normal handler class for PointCloud geometry.
virtual std::string getName() const
Class getName method.
PointCloudGeometryHandler(const PointCloudConstPtr &cloud, const Eigen::Vector4f &=Eigen::Vector4f::Zero())
Constructor.
PointCloudGeometryHandler(const PointCloudConstPtr &cloud)
Constructor.
virtual ~PointCloudGeometryHandlerCustom()
Destructor.
PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
bool isCapable() const
Checl if this handler is capable of handling the input data or not.
typename PointCloud::ConstPtr PointCloudConstPtr
PointCloudGeometryHandlerSurfaceNormal(const PointCloudConstPtr &cloud)
Constructor.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
virtual ~PointCloudGeometryHandlerXYZ()
Destructor.
virtual std::string getName() const
Class 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.
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
index_t field_z_idx_
The index of the field holding the Z data.
shared_ptr< const PointCloudGeometryHandler< PointT > > ConstPtr
PointCloud represents the base class in PCL for storing collections of 3D points. ...
virtual std::string getName() const
Class getName method.
shared_ptr< PointCloudGeometryHandler< PointT > > Ptr
virtual ~PointCloudGeometryHandler()
Destructor.
virtual std::string getName() const
Class getName method.
shared_ptr< PointCloudGeometryHandler< PointCloud > > Ptr
virtual ~PointCloudGeometryHandler()
Destructor.
shared_ptr< const PointCloud< PointT > > ConstPtr
Base handler class for PointCloud geometry.
typename PointCloud::Ptr PointCloudPtr
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 =0
Abstract getName method.
index_t field_y_idx_
The index of the field holding the Y data.
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudGeometryHandlerXYZ()
Destructor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
virtual void getGeometry(vtkSmartPointer< vtkPoints > &points) const
Obtain the actual point geometry for the input dataset in VTK format.
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
shared_ptr< const PointCloudGeometryHandler< PointCloud > > ConstPtr
index_t field_x_idx_
The index of the field holding the X data.
PointCloudConstPtr cloud_
A pointer to the input dataset.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
index_t field_z_idx_
The index of the field holding the Z data.
PointCloud::Ptr PointCloudPtr
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getFieldName() const
Get the name of the field used.