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(double r, double g, double b)
Constructor.
int field_idx_
The index of the field holding the data that represents the color.
bool isCapable() const
Check if this handler is capable of handling the input data or not.
virtual std::string getName() const
Get the name of the class.
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.
virtual ~PointCloudColorHandlerRGBField()
Empty destructor.
virtual std::string getName() const
Abstract getName method.
boost::shared_ptr< PointCloudColorHandlerRGBField< PointCloud > > Ptr
virtual std::string getName() const
Get the name of the class.
int v_field_idx_
The field index for "V".
PointCloud::ConstPtr PointCloudConstPtr
virtual ~PointCloudColorHandlerCustom()
Destructor.
boost::shared_ptr< const PointCloudColorHandlerCustom< PointT > > ConstPtr
virtual std::string getName() const
Class getName method.
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandlerRGBField(const PointCloudConstPtr &cloud)
Constructor.
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
boost::shared_ptr< PointCloudColorHandler< PointCloud > > Ptr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
HSV handler class for colors.
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
virtual std::string getFieldName() const =0
Abstract getFieldName method.
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
boost::shared_ptr< PointCloud< PointT > > Ptr
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Handler for predefined user colors.
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
PointCloudColorHandlerHSVField(const PointCloudConstPtr &cloud)
Constructor.
Base Handler class for PointCloud colors.
virtual std::string getFieldName() const
Get the name of the field used.
virtual std::string getName() const
Class getName method.
virtual std::string getName() const
Abstract getName method.
boost::shared_ptr< const PointCloudColorHandlerRandom< PointT > > ConstPtr
PointCloudColorHandlerGenericField(const PointCloudConstPtr &cloud, const std::string &field_name)
Constructor.
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointCloud > > ConstPtr
PointCloudConstPtr cloud_
A pointer to the input dataset.
int s_field_idx_
The field index for "S".
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
virtual std::string getFieldName() const
Get the name of the field used.
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointT > > ConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
virtual std::string getFieldName() const
Get the name of the field used.
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
PointCloudColorHandlerRGBField()
Constructor.
Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)
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.
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointCloud > > ConstPtr
bool isCapable() const
Return whether this handler is capable of handling the input data or not.
boost::shared_ptr< const PointCloudColorHandler< PointT > > ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRandom< PointCloud > > ConstPtr
virtual std::string getName() const =0
Abstract getName method.
int v_field_idx_
The field index for "V".
boost::shared_ptr< PointCloudColorHandlerRGBField< PointT > > Ptr
boost::shared_ptr< PointCloudColorHandlerGenericField< PointCloud > > Ptr
virtual std::string getName() const
Get the name of the class.
PointCloud::Ptr PointCloudPtr
virtual std::string getName() const
Get the name of the class.
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointT > > ConstPtr
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
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.
boost::shared_ptr< PointCloudColorHandlerRandom< PointCloud > > Ptr
PointCloudConstPtr cloud_
A pointer to the input dataset.
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
boost::shared_ptr< PointCloudColorHandlerHSVField< PointCloud > > Ptr
virtual std::string getName() const
Get the name of the class.
virtual std::string getName() const
Class getName method.
int s_field_idx_
The field index for "S".
PointCloud::Ptr PointCloudPtr
Generic field handler class for colors.
virtual ~PointCloudColorHandlerCustom()
Empty destructor.
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
A point structure representing Euclidean xyz coordinates, and the RGB color.
PointCloud::ConstPtr PointCloudConstPtr
virtual std::string getFieldName() const
Get the name of the field used.
virtual ~PointCloudColorHandlerRandom()
Empty destructor.
PointCloudColorHandler()
Constructor.
bool capable_
True if this handler is capable of handling the input data, false otherwise.
boost::shared_ptr< PointCloudColorHandlerRandom< PointT > > Ptr
virtual ~PointCloudColorHandlerGenericField()
Empty destructor.
virtual ~PointCloudColorHandler()
Destructor.
boost::shared_ptr< const PointCloudColorHandler< PointCloud > > ConstPtr
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
PointCloudColorHandlerGenericField(const std::string &field_name)
Constructor.
RGB handler class for colors.
boost::shared_ptr< PointCloudColorHandlerGenericField< PointT > > Ptr
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointCloud > > ConstPtr
boost::shared_ptr< PointCloudColorHandler< PointT > > Ptr
pcl::PointCloud< PointT > PointCloud
pcl::PCLPointCloud2 PointCloud
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
boost::shared_ptr< PointCloudColorHandlerCustom< PointT > > Ptr
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.
PointCloudColorHandlerRandom()
Constructor.
double r_
Internal R, G, B holding the values given by the user.
virtual ~PointCloudColorHandlerRGBField()
Destructor.
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
virtual ~PointCloudColorHandlerGenericField()
Destructor.
boost::shared_ptr< PointCloudColorHandlerHSVField< PointT > > Ptr
virtual std::string getFieldName() const
Get the name of the field used.
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointT > > ConstPtr
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const =0
Obtain the actual color for the input dataset as vtk scalars.
virtual ~PointCloudColorHandler()
Destructor.