Point Cloud Library (PCL)
1.11.0
|
41 #pragma GCC system_header
46 #include <pcl/point_cloud.h>
47 #include <pcl/common/io.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> >;
117 PCL_DEPRECATED(1, 12,
"use getColor() without parameters instead")
121 return scalars.Get() !=
nullptr;
154 template <
typename Po
intT>
162 using Ptr = shared_ptr<PointCloudColorHandlerRandom<PointT> >;
163 using ConstPtr = shared_ptr<const PointCloudColorHandlerRandom<PointT> >;
181 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
204 template <
typename Po
intT>
212 using Ptr = shared_ptr<PointCloudColorHandlerCustom<PointT> >;
213 using ConstPtr = shared_ptr<const PointCloudColorHandlerCustom<PointT> >;
227 double r,
double g,
double b)
241 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
267 template <
typename Po
intT>
275 using Ptr = shared_ptr<PointCloudColorHandlerRGBField<PointT> >;
276 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBField<PointT> >;
312 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
327 template <
typename Po
intT>
335 using Ptr = shared_ptr<PointCloudColorHandlerHSVField<PointT> >;
336 using ConstPtr = shared_ptr<const PointCloudColorHandlerHSVField<PointT> >;
356 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
377 template <
typename Po
intT>
385 using Ptr = shared_ptr<PointCloudColorHandlerGenericField<PointT> >;
386 using ConstPtr = shared_ptr<const PointCloudColorHandlerGenericField<PointT> >;
390 : field_name_ (field_name)
397 const std::string &field_name)
399 , field_name_ (field_name)
424 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
433 std::string field_name_;
443 template <
typename Po
intT>
451 using Ptr = shared_ptr<PointCloudColorHandlerRGBAField<PointT> >;
452 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBAField<PointT> >;
488 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
504 template <
typename Po
intT>
512 using Ptr = shared_ptr<PointCloudColorHandlerLabelField<PointT> >;
513 using ConstPtr = shared_ptr<const PointCloudColorHandlerLabelField<PointT> >;
521 static_mapping_ = static_mapping;
527 const bool static_mapping =
true)
531 static_mapping_ = static_mapping;
555 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
563 bool static_mapping_;
579 using Ptr = shared_ptr<PointCloudColorHandler<PointCloud> >;
580 using ConstPtr = shared_ptr<const PointCloudColorHandler<PointCloud> >;
584 cloud_ (cloud), capable_ (false), field_idx_ ()
596 getName ()
const = 0;
600 getFieldName ()
const = 0;
619 PCL_DEPRECATED(1, 12,
"use getColor() without parameters instead")
622 scalars = getColor ();
623 return scalars.Get() !=
nullptr;
661 using Ptr = shared_ptr<PointCloudColorHandlerRandom<PointCloud> >;
662 using ConstPtr = shared_ptr<const PointCloudColorHandlerRandom<PointCloud> >;
676 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
683 getColor ()
const override;
704 double r,
double g,
double b) :
706 r_ (r), g_ (g), b_ (b)
716 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
723 getColor ()
const override;
746 using Ptr = shared_ptr<PointCloudColorHandlerRGBField<PointCloud> >;
747 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBField<PointCloud> >;
756 getColor ()
const override;
763 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
783 using Ptr = shared_ptr<PointCloudColorHandlerHSVField<PointCloud> >;
784 using ConstPtr = shared_ptr<const PointCloudColorHandlerHSVField<PointCloud> >;
793 getColor ()
const override;
800 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
827 using Ptr = shared_ptr<PointCloudColorHandlerGenericField<PointCloud> >;
828 using ConstPtr = shared_ptr<const PointCloudColorHandlerGenericField<PointCloud> >;
832 const std::string &field_name);
838 getColor ()
const override;
845 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
853 std::string field_name_;
870 using Ptr = shared_ptr<PointCloudColorHandlerRGBAField<PointCloud> >;
871 using ConstPtr = shared_ptr<const PointCloudColorHandlerRGBAField<PointCloud> >;
880 getColor ()
const override;
887 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
908 using Ptr = shared_ptr<PointCloudColorHandlerLabelField<PointCloud> >;
909 using ConstPtr = shared_ptr<const PointCloudColorHandlerLabelField<PointCloud> >;
914 const bool static_mapping =
true);
920 getColor ()
const override;
927 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
933 bool static_mapping_;
939 #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.
#define PCL_DEPRECATED(Major, Minor, Message)
macro for compatibility across compilers and help remove old deprecated items for the Major....
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.
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.