Point Cloud Library (PCL)
1.12.1-dev
|
41 #pragma GCC system_header
46 #include <pcl/point_cloud.h>
47 #include <pcl/PCLPointCloud2.h>
48 #include <pcl/visualization/common/common.h>
50 #include <vtkSmartPointer.h>
51 #include <vtkDataArray.h>
52 #include <vtkFloatArray.h>
53 #include <vtkUnsignedCharArray.h>
57 namespace visualization
64 template <
typename Po
intT>
72 using Ptr = shared_ptr<PointCloudColorHandler<PointT> >;
73 using ConstPtr = shared_ptr<const PointCloudColorHandler<PointT> >;
137 template <
typename Po
intT>
145 using Ptr = shared_ptr<PointCloudColorHandlerRandom<PointT> >;
146 using ConstPtr = shared_ptr<const PointCloudColorHandlerRandom<PointT> >;
164 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
185 template <
typename Po
intT>
193 using Ptr = shared_ptr<PointCloudColorHandlerCustom<PointT> >;
194 using ConstPtr = shared_ptr<const PointCloudColorHandlerCustom<PointT> >;
208 double r,
double g,
double b)
222 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
246 template <
typename Po
intT>
254 using Ptr = shared_ptr<PointCloudColorHandlerRGBField<PointT> >;
255 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBField<PointT> >;
289 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
304 template <
typename Po
intT>
312 using Ptr = shared_ptr<PointCloudColorHandlerHSVField<PointT> >;
313 using ConstPtr = shared_ptr<const PointCloudColorHandlerHSVField<PointT> >;
331 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
352 template <
typename Po
intT>
360 using Ptr = shared_ptr<PointCloudColorHandlerGenericField<PointT> >;
361 using ConstPtr = shared_ptr<const PointCloudColorHandlerGenericField<PointT> >;
365 : field_name_ (field_name)
372 const std::string &field_name)
374 , field_name_ (field_name)
397 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
406 std::string field_name_;
416 template <
typename Po
intT>
424 using Ptr = shared_ptr<PointCloudColorHandlerRGBAField<PointT> >;
425 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBAField<PointT> >;
459 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
475 template <
typename Po
intT>
483 using Ptr = shared_ptr<PointCloudColorHandlerLabelField<PointT> >;
484 using ConstPtr = shared_ptr<const PointCloudColorHandlerLabelField<PointT> >;
492 static_mapping_ = static_mapping;
498 const bool static_mapping =
true)
502 static_mapping_ = static_mapping;
526 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
534 bool static_mapping_;
550 using Ptr = shared_ptr<PointCloudColorHandler<PointCloud> >;
551 using ConstPtr = shared_ptr<const PointCloudColorHandler<PointCloud> >;
555 cloud_ (cloud), capable_ (false), field_idx_ ()
567 getName ()
const = 0;
571 getFieldName ()
const = 0;
580 getColor()
const = 0;
617 using Ptr = shared_ptr<PointCloudColorHandlerRandom<PointCloud> >;
618 using ConstPtr = shared_ptr<const PointCloudColorHandlerRandom<PointCloud> >;
632 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
639 getColor ()
const override;
658 double r,
double g,
double b) :
660 r_ (r), g_ (g), b_ (b)
670 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
677 getColor ()
const override;
698 using Ptr = shared_ptr<PointCloudColorHandlerRGBField<PointCloud> >;
699 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBField<PointCloud> >;
708 getColor ()
const override;
713 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
733 using Ptr = shared_ptr<PointCloudColorHandlerHSVField<PointCloud> >;
734 using ConstPtr = shared_ptr<const PointCloudColorHandlerHSVField<PointCloud> >;
743 getColor ()
const override;
748 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
775 using Ptr = shared_ptr<PointCloudColorHandlerGenericField<PointCloud> >;
776 using ConstPtr = shared_ptr<const PointCloudColorHandlerGenericField<PointCloud> >;
780 const std::string &field_name);
786 getColor ()
const override;
791 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
799 std::string field_name_;
816 using Ptr = shared_ptr<PointCloudColorHandlerRGBAField<PointCloud> >;
817 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBAField<PointCloud> >;
826 getColor ()
const override;
831 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
852 using Ptr = shared_ptr<PointCloudColorHandlerLabelField<PointCloud> >;
853 using ConstPtr = shared_ptr<const PointCloudColorHandlerLabelField<PointCloud> >;
858 const bool static_mapping =
true);
864 getColor ()
const override;
869 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
875 bool static_mapping_;
881 #include <pcl/visualization/impl/point_cloud_color_handlers.hpp>
int field_idx_
The index of the field holding the data that represents the color.
Defines all the PCL and non-PCL macros used.
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 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 vtkSmartPointer< vtkDataArray > getColor() const =0
Obtain the actual color for the input dataset as a VTK data array.
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
shared_ptr< PointCloudColorHandler< PointT > > Ptr
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 ~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.
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.
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.