37 #ifndef PCL_POINT_CLOUD_COLOR_HANDLERS_H_ 38 #define PCL_POINT_CLOUD_COLOR_HANDLERS_H_ 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>
71 typedef boost::shared_ptr<PointCloudColorHandler<PointT> >
Ptr;
72 typedef boost::shared_ptr<const PointCloudColorHandler<PointT> >
ConstPtr;
137 template <
typename Po
intT>
145 typedef boost::shared_ptr<PointCloudColorHandlerRandom<PointT> >
Ptr;
146 typedef boost::shared_ptr<const PointCloudColorHandlerRandom<PointT> >
ConstPtr;
164 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
190 template <
typename Po
intT>
198 typedef boost::shared_ptr<PointCloudColorHandlerCustom<PointT> >
Ptr;
199 typedef boost::shared_ptr<const PointCloudColorHandlerCustom<PointT> >
ConstPtr;
213 double r,
double g,
double b)
227 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
256 template <
typename Po
intT>
264 typedef boost::shared_ptr<PointCloudColorHandlerRGBField<PointT> >
Ptr;
265 typedef boost::shared_ptr<const PointCloudColorHandlerRGBField<PointT> >
ConstPtr;
304 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
319 template <
typename Po
intT>
327 typedef boost::shared_ptr<PointCloudColorHandlerHSVField<PointT> >
Ptr;
328 typedef boost::shared_ptr<const PointCloudColorHandlerHSVField<PointT> >
ConstPtr;
351 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
372 template <
typename Po
intT>
380 typedef boost::shared_ptr<PointCloudColorHandlerGenericField<PointT> >
Ptr;
381 typedef boost::shared_ptr<const PointCloudColorHandlerGenericField<PointT> >
ConstPtr;
385 : field_name_ (field_name)
392 const std::string &field_name)
394 , field_name_ (field_name)
422 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
431 std::string field_name_;
441 template <
typename Po
intT>
449 typedef boost::shared_ptr<PointCloudColorHandlerRGBAField<PointT> >
Ptr;
450 typedef boost::shared_ptr<const PointCloudColorHandlerRGBAField<PointT> >
ConstPtr;
489 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
504 template <
typename Po
intT>
512 typedef boost::shared_ptr<PointCloudColorHandlerLabelField<PointT> >
Ptr;
513 typedef boost::shared_ptr<const PointCloudColorHandlerLabelField<PointT> >
ConstPtr;
521 static_mapping_ = static_mapping;
527 const bool static_mapping =
true)
531 static_mapping_ = static_mapping;
558 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
566 bool static_mapping_;
582 typedef boost::shared_ptr<PointCloudColorHandler<PointCloud> >
Ptr;
583 typedef boost::shared_ptr<const PointCloudColorHandler<PointCloud> >
ConstPtr;
587 cloud_ (cloud), capable_ (false), field_idx_ ()
599 getName ()
const = 0;
603 getFieldName ()
const = 0;
648 typedef boost::shared_ptr<PointCloudColorHandlerRandom<PointCloud> >
Ptr;
649 typedef boost::shared_ptr<const PointCloudColorHandlerRandom<PointCloud> >
ConstPtr;
663 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
694 double r,
double g,
double b) :
696 r_ (r), g_ (g), b_ (b)
706 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
739 typedef boost::shared_ptr<PointCloudColorHandlerRGBField<PointCloud> >
Ptr;
740 typedef boost::shared_ptr<const PointCloudColorHandlerRGBField<PointCloud> >
ConstPtr;
759 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
779 typedef boost::shared_ptr<PointCloudColorHandlerHSVField<PointCloud> >
Ptr;
780 typedef boost::shared_ptr<const PointCloudColorHandlerHSVField<PointCloud> >
ConstPtr;
799 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
826 typedef boost::shared_ptr<PointCloudColorHandlerGenericField<PointCloud> >
Ptr;
827 typedef boost::shared_ptr<const PointCloudColorHandlerGenericField<PointCloud> >
ConstPtr;
831 const std::string &field_name);
847 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
855 std::string field_name_;
872 typedef boost::shared_ptr<PointCloudColorHandlerRGBAField<PointCloud> >
Ptr;
873 typedef boost::shared_ptr<const PointCloudColorHandlerRGBAField<PointCloud> >
ConstPtr;
892 getName ()
const {
return (
"PointCloudColorHandlerRGBAField"); }
913 typedef boost::shared_ptr<PointCloudColorHandlerLabelField<PointCloud> >
Ptr;
914 typedef boost::shared_ptr<const PointCloudColorHandlerLabelField<PointCloud> >
ConstPtr;
919 const bool static_mapping =
true);
935 getName ()
const {
return (
"PointCloudColorHandlerLabelField"); }
941 bool static_mapping_;
947 #include <pcl/visualization/impl/point_cloud_color_handlers.hpp> 949 #endif // PCL_POINT_CLOUD_COLOR_HANDLERS_H_ PointCloudConstPtr cloud_
A pointer to the input dataset.
virtual std::string getFieldName() const
Get the name of the field used.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointT > > ConstPtr
PointCloudColorHandlerRandom()
Constructor.
virtual ~PointCloudColorHandlerCustom()
Empty destructor.
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudColorHandlerRandom()
Empty destructor.
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointCloud > > ConstPtr
Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)
virtual std::string getFieldName() const
Get the name of the field used.
Label field handler class for colors.
virtual std::string getName() const
Class getName method.
virtual std::string getName() const
Class getName method.
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointCloud > > ConstPtr
virtual ~PointCloudColorHandlerRGBField()
Destructor.
boost::shared_ptr< const PointCloudColorHandlerRandom< PointCloud > > ConstPtr
PointCloud::Ptr PointCloudPtr
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
PointCloud::Ptr PointCloudPtr
virtual ~PointCloudColorHandlerGenericField()
Empty destructor.
virtual std::string getFieldName() const
Get the name of the field used.
boost::shared_ptr< PointCloudColorHandlerLabelField< PointCloud > > Ptr
boost::shared_ptr< PointCloudColorHandlerGenericField< PointCloud > > Ptr
virtual std::string getName() const
Abstract getName method.
boost::shared_ptr< PointCloudColorHandlerGenericField< PointT > > Ptr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
boost::shared_ptr< const PointCloudColorHandler< PointCloud > > ConstPtr
PointCloudColorHandlerLabelField(const bool static_mapping=true)
Constructor.
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 bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
PointCloudColorHandlerRGBField()
Constructor.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
virtual ~PointCloudColorHandlerRGBAField()
Destructor.
virtual ~PointCloudColorHandlerRGBAField()
Empty destructor.
PointCloudColorHandlerLabelField(const PointCloudConstPtr &cloud, const bool static_mapping=true)
Constructor.
boost::shared_ptr< PointCloudColorHandlerHSVField< PointCloud > > Ptr
PointCloudColorHandlerHSVField(const PointCloudConstPtr &cloud)
Constructor.
PointCloudColorHandlerRGBField(const PointCloudConstPtr &cloud)
Constructor.
virtual ~PointCloudColorHandlerLabelField()
Destructor.
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
virtual std::string getName() const
Get the name of the class.
bool isCapable() const
Return whether this handler is capable of handling the input data or not.
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudColorHandlerCustom()
Destructor.
boost::shared_ptr< PointCloudColorHandlerLabelField< PointT > > Ptr
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
Base Handler class for PointCloud colors.
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< const PointCloudColorHandlerRGBAField< PointT > > ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRGBAField< PointCloud > > ConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
int s_field_idx_
The field index for "S".
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
virtual std::string getName() const
Get the name of the class.
PointCloudColorHandlerCustom(double r, double g, double b)
Constructor.
boost::shared_ptr< PointCloud< PointT > > Ptr
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
virtual std::string getName() const
Abstract getName method.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
PointCloudColorHandlerGenericField(const std::string &field_name)
Constructor.
boost::shared_ptr< PointCloudColorHandlerRandom< PointCloud > > Ptr
virtual ~PointCloudColorHandlerRGBField()
Empty destructor.
HSV handler class for colors.
boost::shared_ptr< PointCloudColorHandlerRGBAField< PointT > > Ptr
boost::shared_ptr< PointCloudColorHandlerHSVField< PointT > > Ptr
virtual ~PointCloudColorHandlerLabelField()
Empty destructor.
boost::shared_ptr< const PointCloudColorHandlerLabelField< PointT > > ConstPtr
virtual std::string getName() const
Class getName method.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
double r_
Internal R, G, B holding the values given by the user.
virtual std::string getName() const
Get the name of the class.
Handler for predefined user colors.
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointCloud > > ConstPtr
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
RGB handler class for colors.
PointCloudColorHandler()
Constructor.
boost::shared_ptr< const PointCloudColorHandlerRandom< PointT > > ConstPtr
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
virtual std::string getName() const
Class getName method.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
int s_field_idx_
The field index for "S".
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
virtual std::string getName() const
Class getName method.
Generic field handler class for colors.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
boost::shared_ptr< PointCloudColorHandlerRandom< PointT > > Ptr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloud represents the base class in PCL for storing collections of 3D points. ...
virtual std::string getName() const
Get the name of the class.
virtual ~PointCloudColorHandler()
Destructor.
pcl::PCLPointCloud2 PointCloud
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
boost::shared_ptr< PointCloudColorHandler< PointCloud > > Ptr
int v_field_idx_
The field index for "V".
int v_field_idx_
The field index for "V".
boost::shared_ptr< const PointCloudColorHandlerCustom< PointT > > ConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandlerRGBAField(const PointCloudConstPtr &cloud)
Constructor.
int field_idx_
The index of the field holding the data that represents the color.
boost::shared_ptr< PointCloudColorHandler< PointT > > Ptr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudConstPtr cloud_
A pointer to the input dataset.
virtual std::string getFieldName() const
Get the name of the field used.
bool isCapable() const
Check if this handler is capable of handling the input data or not.
boost::shared_ptr< const PointCloudColorHandler< PointT > > ConstPtr
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointT > > ConstPtr
boost::shared_ptr< PointCloudColorHandlerCustom< PointT > > Ptr
boost::shared_ptr< PointCloudColorHandlerRGBField< PointT > > Ptr
PointCloudColorHandlerGenericField(const PointCloudConstPtr &cloud, const std::string &field_name)
Constructor.
virtual std::string getFieldName() const
Get the name of the field used.
int field_idx_
The index of the field holding the data that represents the color.
A point structure representing Euclidean xyz coordinates, and the RGB color.
boost::shared_ptr< const PointCloudColorHandlerLabelField< PointCloud > > ConstPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointT > > ConstPtr
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
virtual std::string getName() const =0
Abstract getName method.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
virtual ~PointCloudColorHandler()
Destructor.
virtual std::string getName() const
Get the name of the class.
boost::shared_ptr< PointCloudColorHandlerRGBField< PointCloud > > Ptr
PointCloudColorHandlerRGBAField()
Constructor.
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< PointCloudColorHandlerRGBAField< PointCloud > > Ptr
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const =0
Obtain the actual color for the input dataset as vtk scalars.
virtual ~PointCloudColorHandlerGenericField()
Destructor.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
RGBA handler class for colors.
double r_
Internal R, G, B holding the values given by the user.
pcl::PointCloud< PointT > PointCloud
virtual std::string getName() const
Get the name of the class.
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
virtual std::string getFieldName() const
Get the name of the field used.