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_;
447 typedef boost::shared_ptr<PointCloudColorHandler<PointCloud> >
Ptr;
448 typedef boost::shared_ptr<const PointCloudColorHandler<PointCloud> >
ConstPtr;
452 cloud_ (cloud), capable_ (false), field_idx_ ()
464 getName ()
const = 0;
468 getFieldName ()
const = 0;
513 typedef boost::shared_ptr<PointCloudColorHandlerRandom<PointCloud> >
Ptr;
514 typedef boost::shared_ptr<const PointCloudColorHandlerRandom<PointCloud> >
ConstPtr;
528 getName ()
const {
return (
"PointCloudColorHandlerRandom"); }
559 double r,
double g,
double b) :
561 r_ (r), g_ (g), b_ (b)
571 getName ()
const {
return (
"PointCloudColorHandlerCustom"); }
604 typedef boost::shared_ptr<PointCloudColorHandlerRGBField<PointCloud> >
Ptr;
605 typedef boost::shared_ptr<const PointCloudColorHandlerRGBField<PointCloud> >
ConstPtr;
624 getName ()
const {
return (
"PointCloudColorHandlerRGBField"); }
644 typedef boost::shared_ptr<PointCloudColorHandlerHSVField<PointCloud> >
Ptr;
645 typedef boost::shared_ptr<const PointCloudColorHandlerHSVField<PointCloud> >
ConstPtr;
664 getName ()
const {
return (
"PointCloudColorHandlerHSVField"); }
691 typedef boost::shared_ptr<PointCloudColorHandlerGenericField<PointCloud> >
Ptr;
692 typedef boost::shared_ptr<const PointCloudColorHandlerGenericField<PointCloud> >
ConstPtr;
696 const std::string &field_name);
712 getName ()
const {
return (
"PointCloudColorHandlerGenericField"); }
720 std::string field_name_;
725 #include <pcl/visualization/impl/point_cloud_color_handlers.hpp>
727 #endif // PCL_POINT_CLOUD_COLOR_HANDLERS_H_
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getName() const
Class getName method.
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
boost::shared_ptr< PointCloudColorHandler< PointT > > Ptr
PointCloudColorHandlerGenericField(const std::string &field_name)
Constructor.
virtual ~PointCloudColorHandlerRGBField()
Destructor.
PointCloudColorHandlerRGBField(const PointCloudConstPtr &cloud)
Constructor.
PointCloudColorHandlerCustom(double r, double g, double b)
Constructor.
boost::shared_ptr< const PointCloudColorHandlerCustom< PointT > > ConstPtr
virtual std::string getName() const
Class getName method.
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
boost::shared_ptr< PointCloudColorHandlerRandom< PointT > > Ptr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
RGB handler class for colors.
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointT > > ConstPtr
boost::shared_ptr< const PointCloudColorHandler< PointT > > ConstPtr
boost::shared_ptr< PointCloudColorHandlerGenericField< PointCloud > > Ptr
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 vtk scalars.
PointCloudColorHandlerHSVField(const PointCloudConstPtr &cloud)
Constructor.
virtual std::string getName() const
Abstract getName method.
boost::shared_ptr< PointCloudColorHandlerGenericField< PointT > > Ptr
PointCloudConstPtr cloud_
A pointer to the input dataset.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointT > > ConstPtr
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointCloud > > ConstPtr
Generic field handler class for colors.
double r_
Internal R, G, B holding the values given by the user.
virtual std::string getName() const
Get the name of the class.
PointCloudColorHandlerRandom()
Constructor.
virtual std::string getFieldName() const
Get the name of the field used.
int v_field_idx_
The field index for "V".
PointCloudColorHandlerGenericField(const PointCloudConstPtr &cloud, const std::string &field_name)
Constructor.
boost::shared_ptr< PointCloudColorHandlerHSVField< PointT > > Ptr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointCloud > > ConstPtr
boost::shared_ptr< PointCloudColorHandlerRandom< PointCloud > > Ptr
boost::shared_ptr< PointCloudColorHandler< PointCloud > > Ptr
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be 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.
PointCloud::Ptr PointCloudPtr
virtual std::string getName() const
Get the name of the class.
int s_field_idx_
The field index for "S".
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
virtual ~PointCloudColorHandlerCustom()
Empty destructor.
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
virtual ~PointCloudColorHandlerRandom()
Empty destructor.
boost::shared_ptr< PointCloudColorHandlerCustom< PointT > > Ptr
Base Handler class for PointCloud colors.
virtual std::string getName() const =0
Abstract getName method.
int field_idx_
The index of the field holding the data that represents the color.
virtual ~PointCloudColorHandlerRGBField()
Empty destructor.
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
pcl::PCLPointCloud2 PointCloud
virtual std::string getName() const
Class getName method.
virtual ~PointCloudColorHandler()
Destructor.
virtual std::string getName() const
Get the name of the class.
boost::shared_ptr< PointCloud< PointT > > Ptr
boost::shared_ptr< PointCloudColorHandlerHSVField< PointCloud > > Ptr
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const =0
Obtain the actual color for the input dataset as vtk scalars.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
int s_field_idx_
The field index for "S".
int field_idx_
The index of the field holding the data that represents the color.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)
PointCloudConstPtr cloud_
A pointer to the input dataset.
HSV handler class for colors.
virtual std::string getFieldName() const
Get the name of the field used.
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
bool isCapable() const
Return whether this handler is capable of handling the input data or not.
boost::shared_ptr< const PointCloudColorHandler< PointCloud > > ConstPtr
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
PointCloudColorHandlerRGBField()
Constructor.
virtual ~PointCloudColorHandlerCustom()
Destructor.
virtual std::string getName() const
Get the name of the class.
int v_field_idx_
The field index for "V".
boost::shared_ptr< PointCloudColorHandlerRGBField< PointT > > Ptr
virtual std::string getName() const
Get the name of the class.
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointCloud > > ConstPtr
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointT > > ConstPtr
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.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
PointCloud::ConstPtr PointCloudConstPtr
boost::shared_ptr< const PointCloudColorHandlerRandom< PointT > > ConstPtr
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 ~PointCloudColorHandlerGenericField()
Destructor.
virtual ~PointCloudColorHandlerGenericField()
Empty destructor.
double r_
Internal R, G, B holding the values given by the user.
PointCloud::Ptr PointCloudPtr
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
virtual ~PointCloudColorHandler()
Destructor.
pcl::PointCloud< PointT > PointCloud
PointCloudColorHandler()
Constructor.
bool isCapable() const
Check if this handler is capable of handling the input data or not.
A point structure representing Euclidean xyz coordinates, and the RGB color.
boost::shared_ptr< const PointCloudColorHandlerRandom< PointCloud > > ConstPtr
Handler for predefined user colors.
boost::shared_ptr< PointCloudColorHandlerRGBField< PointCloud > > Ptr
virtual std::string getName() const
Abstract getName method.