Point Cloud Library (PCL)
1.10.0
|
41 #pragma GCC system_header
45 #include <pcl/point_cloud.h>
46 #include <pcl/common/io.h>
47 #include <pcl/visualization/common/common.h>
49 #include <vtkSmartPointer.h>
50 #include <vtkDataArray.h>
51 #include <vtkFloatArray.h>
52 #include <vtkUnsignedCharArray.h>
56 namespace visualization
63 template <
typename Po
intT>
116 [[deprecated(
"use getColor() without parameters instead")]]
120 return scalars.Get() !=
nullptr;
153 template <
typename Po
intT>
180 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
203 template <
typename Po
intT>
226 double r,
double g,
double b)
240 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
266 template <
typename Po
intT>
311 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
326 template <
typename Po
intT>
355 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
376 template <
typename Po
intT>
389 : field_name_ (field_name)
396 const std::string &field_name)
398 , field_name_ (field_name)
423 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
432 std::string field_name_;
442 template <
typename Po
intT>
487 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
503 template <
typename Po
intT>
520 static_mapping_ = static_mapping;
526 const bool static_mapping =
true)
530 static_mapping_ = static_mapping;
554 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
562 bool static_mapping_;
583 cloud_ (cloud), capable_ (false), field_idx_ ()
595 getName ()
const = 0;
599 getFieldName ()
const = 0;
618 [[deprecated(
"use getColor() without parameters instead")]]
621 scalars = getColor ();
622 return scalars.Get() !=
nullptr;
675 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
682 getColor ()
const override;
703 double r,
double g,
double b) :
705 r_ (r), g_ (g), b_ (b)
715 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
722 getColor ()
const override;
755 getColor ()
const override;
762 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
792 getColor ()
const override;
799 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
831 const std::string &field_name);
837 getColor ()
const override;
844 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
852 std::string field_name_;
879 getColor ()
const override;
886 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
913 const bool static_mapping =
true);
919 getColor ()
const override;
926 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
932 bool static_mapping_;
938 #include <pcl/visualization/impl/point_cloud_color_handlers.hpp>
int field_idx_
The index of the field holding the data that represents the color.
This file defines compatibility wrappers for low level I/O functions.
virtual std::string getName() const
Abstract getName method.
typename PointCloud::ConstPtr PointCloudConstPtr
PointCloudColorHandlerGenericField(const PointCloudConstPtr &cloud, const std::string &field_name)
Constructor.
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
HSV handler class for colors.
virtual ~PointCloudColorHandlerRandom()
Empty destructor.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
virtual std::string getName() const
Get the name of the class.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
virtual std::string getName() const
Get the name of the class.
virtual std::string getName() const
Get the name of the class.
Handler for predefined user colors.
Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)
PointCloud::Ptr PointCloudPtr
Base Handler class for PointCloud colors.
virtual ~PointCloudColorHandlerCustom()
Destructor.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
virtual std::string getName() const =0
Abstract getName method.
virtual std::string getName() const
Abstract getName method.
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getFieldName() const
Get the name of the field used.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as a VTK data array.
virtual std::string getName() const
Class getName method.
shared_ptr< PointCloudColorHandler< PointCloud > > Ptr
PointCloud represents the base class in PCL for storing collections of 3D points.
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudColorHandler()
Destructor.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
double r_
Internal R, G, B holding the values given by the user.
A point structure representing Euclidean xyz coordinates, and the RGB color.
int v_field_idx_
The field index for "V".
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
shared_ptr< const PointCloudColorHandler< PointCloud > > ConstPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
bool isCapable() const
Return whether this handler is capable of handling the input data or not.
virtual ~PointCloudColorHandlerRGBField()
Empty destructor.
PointCloudColorHandlerLabelField(const bool static_mapping=true)
Constructor.
typename PointCloud::Ptr PointCloudPtr
shared_ptr< const PointCloudColorHandler< PointT > > ConstPtr
virtual ~PointCloudColorHandlerRGBField()
Destructor.
PointCloudConstPtr cloud_
A pointer to the input dataset.
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
PointCloud::ConstPtr PointCloudConstPtr
PointCloudColorHandlerHSVField(const PointCloudConstPtr &cloud)
Constructor.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
virtual ~PointCloudColorHandlerGenericField()
Destructor.
virtual ~PointCloudColorHandlerCustom()
Empty destructor.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getName() const
Get the name of the class.
virtual ~PointCloudColorHandlerRGBAField()
Empty destructor.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
RGBA handler class for colors.
virtual std::string getFieldName() const
Get the name of the field used.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudColorHandler()
Destructor.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
PointCloudConstPtr cloud_
A pointer to the input dataset.
virtual std::string getName() const
Get the name of the class.
virtual ~PointCloudColorHandlerLabelField()
Destructor.
Label field handler class for colors.
virtual std::string getName() const
Class getName method.
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
PointCloudColorHandler()
Constructor.
PointCloudColorHandlerRGBField(const PointCloudConstPtr &cloud)
Constructor.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
int s_field_idx_
The field index for "S".
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
shared_ptr< PointCloudColorHandler< PointT > > Ptr
virtual vtkSmartPointer< vtkDataArray > getColor() const
Obtain the actual color for the input dataset as a VTK data array.
virtual std::string getName() const
Get the name of the class.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
shared_ptr< PointCloud< PointT > > Ptr
PointCloudColorHandlerRGBField()
Constructor.
PointCloudColorHandlerGenericField(const std::string &field_name)
Constructor.
PointCloudColorHandlerRGBAField()
Constructor.
double r_
Internal R, G, B holding the values given by the user.
PointCloudColorHandlerRGBAField(const PointCloudConstPtr &cloud)
Constructor.
virtual std::string getFieldName() const
Get the name of the field used.
RGB handler class for colors.
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
shared_ptr< const PointCloud< PointT > > ConstPtr
bool capable_
True if this handler is capable of handling the input data, false otherwise.
PointCloudColorHandlerCustom(double r, double g, double b)
Constructor.
virtual vtkSmartPointer< vtkDataArray > getColor() const
Obtain the actual color for the input dataset as a VTK data array.
virtual ~PointCloudColorHandlerGenericField()
Empty destructor.
int v_field_idx_
The field index for "V".
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandlerLabelField(const PointCloudConstPtr &cloud, const bool static_mapping=true)
Constructor.
PointCloudColorHandlerRandom()
Constructor.
virtual std::string getName() const
Class getName method.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as a VTK data array.
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
bool isCapable() const
Check if this handler is capable of handling the input data or not.
virtual std::string getName() const
Class getName method.
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getName() const
Get the name of the class.
int s_field_idx_
The field index for "S".
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getName() const
Class getName method.
Generic field handler class for colors.
boost::shared_ptr< T > shared_ptr
Alias for boost::shared_ptr.
virtual ~PointCloudColorHandlerLabelField()
Empty destructor.
int field_idx_
The index of the field holding the data that represents the color.
vtkSmartPointer< vtkDataArray > getColor() const override
Obtain the actual color for the input dataset as a VTK data array.
virtual ~PointCloudColorHandlerRGBAField()
Destructor.