Point Cloud Library (PCL)  1.9.1
point_cloud_color_handlers.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2012-, Open Perception, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of the copyright holder(s) nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  */
37 #ifndef PCL_POINT_CLOUD_COLOR_HANDLERS_H_
38 #define PCL_POINT_CLOUD_COLOR_HANDLERS_H_
39 
40 #if defined __GNUC__
41 #pragma GCC system_header
42 #endif
43 
44 // PCL includes
45 #include <pcl/point_cloud.h>
46 #include <pcl/common/io.h>
47 #include <pcl/visualization/common/common.h>
48 // VTK includes
49 #include <vtkSmartPointer.h>
50 #include <vtkDataArray.h>
51 #include <vtkFloatArray.h>
52 #include <vtkUnsignedCharArray.h>
53 
54 namespace pcl
55 {
56  namespace visualization
57  {
58  //////////////////////////////////////////////////////////////////////////////////////
59  /** \brief Base Handler class for PointCloud colors.
60  * \author Radu B. Rusu
61  * \ingroup visualization
62  */
63  template <typename PointT>
65  {
66  public:
68  typedef typename PointCloud::Ptr PointCloudPtr;
70 
71  typedef boost::shared_ptr<PointCloudColorHandler<PointT> > Ptr;
72  typedef boost::shared_ptr<const PointCloudColorHandler<PointT> > ConstPtr;
73 
74  /** \brief Constructor. */
76  cloud_ (), capable_ (false), field_idx_ (-1), fields_ ()
77  {}
78 
79  /** \brief Constructor. */
81  cloud_ (cloud), capable_ (false), field_idx_ (-1), fields_ ()
82  {}
83 
84  /** \brief Destructor. */
86 
87  /** \brief Check if this handler is capable of handling the input data or not. */
88  inline bool
89  isCapable () const { return (capable_); }
90 
91  /** \brief Abstract getName method. */
92  virtual std::string
93  getName () const = 0;
94 
95  /** \brief Abstract getFieldName method. */
96  virtual std::string
97  getFieldName () const = 0;
98 
99  /** \brief Obtain the actual color for the input dataset as vtk scalars.
100  * \param[out] scalars the output scalars containing the color for the dataset
101  * \return true if the operation was successful (the handler is capable and
102  * the input cloud was given as a valid pointer), false otherwise
103  */
104  virtual bool
105  getColor (vtkSmartPointer<vtkDataArray> &scalars) const = 0;
106 
107  /** \brief Set the input cloud to be used.
108  * \param[in] cloud the input cloud to be used by the handler
109  */
110  virtual void
112  {
113  cloud_ = cloud;
114  }
115 
116  protected:
117  /** \brief A pointer to the input dataset. */
119 
120  /** \brief True if this handler is capable of handling the input data, false
121  * otherwise.
122  */
123  bool capable_;
124 
125  /** \brief The index of the field holding the data that represents the color. */
127 
128  /** \brief The list of fields available for this PointCloud. */
129  std::vector<pcl::PCLPointField> fields_;
130  };
131 
132  //////////////////////////////////////////////////////////////////////////////////////
133  /** \brief Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)
134  * \author Radu B. Rusu
135  * \ingroup visualization
136  */
137  template <typename PointT>
139  {
141  typedef typename PointCloud::Ptr PointCloudPtr;
142  typedef typename PointCloud::ConstPtr PointCloudConstPtr;
143 
144  public:
145  typedef boost::shared_ptr<PointCloudColorHandlerRandom<PointT> > Ptr;
146  typedef boost::shared_ptr<const PointCloudColorHandlerRandom<PointT> > ConstPtr;
147 
148  /** \brief Constructor. */
151  {
152  capable_ = true;
153  }
154 
155  /** \brief Constructor. */
158  {
159  capable_ = true;
160  }
161 
162  /** \brief Abstract getName method. */
163  virtual std::string
164  getName () const { return ("PointCloudColorHandlerRandom"); }
165 
166  /** \brief Get the name of the field used. */
167  virtual std::string
168  getFieldName () const { return ("[random]"); }
169 
170  /** \brief Obtain the actual color for the input dataset as vtk scalars.
171  * \param[out] scalars the output scalars containing the color for the dataset
172  * \return true if the operation was successful (the handler is capable and
173  * the input cloud was given as a valid pointer), false otherwise
174  */
175  virtual bool
176  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
177 
178  protected:
179  // Members derived from the base class
182  };
183 
184  //////////////////////////////////////////////////////////////////////////////////////
185  /** \brief Handler for predefined user colors. The color at each point will be drawn
186  * as the use given R, G, B values.
187  * \author Radu B. Rusu
188  * \ingroup visualization
189  */
190  template <typename PointT>
192  {
194  typedef typename PointCloud::Ptr PointCloudPtr;
195  typedef typename PointCloud::ConstPtr PointCloudConstPtr;
196 
197  public:
198  typedef boost::shared_ptr<PointCloudColorHandlerCustom<PointT> > Ptr;
199  typedef boost::shared_ptr<const PointCloudColorHandlerCustom<PointT> > ConstPtr;
200 
201  /** \brief Constructor. */
202  PointCloudColorHandlerCustom (double r, double g, double b)
204  , r_ (r)
205  , g_ (g)
206  , b_ (b)
207  {
208  capable_ = true;
209  }
210 
211  /** \brief Constructor. */
213  double r, double g, double b)
214  : PointCloudColorHandler<PointT> (cloud)
215  , r_ (r)
216  , g_ (g)
217  , b_ (b)
218  {
219  capable_ = true;
220  }
221 
222  /** \brief Destructor. */
224 
225  /** \brief Abstract getName method. */
226  virtual std::string
227  getName () const { return ("PointCloudColorHandlerCustom"); }
228 
229  /** \brief Get the name of the field used. */
230  virtual std::string
231  getFieldName () const { return (""); }
232 
233  /** \brief Obtain the actual color for the input dataset as vtk scalars.
234  * \param[out] scalars the output scalars containing the color for the dataset
235  * \return true if the operation was successful (the handler is capable and
236  * the input cloud was given as a valid pointer), false otherwise
237  */
238  virtual bool
239  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
240 
241  protected:
242  // Members derived from the base class
245 
246  /** \brief Internal R, G, B holding the values given by the user. */
247  double r_, g_, b_;
248  };
249 
250  //////////////////////////////////////////////////////////////////////////////////////
251  /** \brief RGB handler class for colors. Uses the data present in the "rgb" or "rgba"
252  * fields as the color at each point.
253  * \author Radu B. Rusu
254  * \ingroup visualization
255  */
256  template <typename PointT>
258  {
260  typedef typename PointCloud::Ptr PointCloudPtr;
261  typedef typename PointCloud::ConstPtr PointCloudConstPtr;
262 
263  public:
264  typedef boost::shared_ptr<PointCloudColorHandlerRGBField<PointT> > Ptr;
265  typedef boost::shared_ptr<const PointCloudColorHandlerRGBField<PointT> > ConstPtr;
266 
267  /** \brief Constructor. */
269  {
270  capable_ = false;
271  }
272 
273  /** \brief Constructor. */
275  : PointCloudColorHandler<PointT> (cloud)
276  {
277  setInputCloud (cloud);
278  }
279 
280  /** \brief Destructor. */
282 
283  /** \brief Get the name of the field used. */
284  virtual std::string
285  getFieldName () const { return ("rgb"); }
286 
287  /** \brief Obtain the actual color for the input dataset as vtk scalars.
288  * \param[out] scalars the output scalars containing the color for the dataset
289  * \return true if the operation was successful (the handler is capable and
290  * the input cloud was given as a valid pointer), false otherwise
291  */
292  virtual bool
293  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
294 
295  /** \brief Set the input cloud to be used.
296  * \param[in] cloud the input cloud to be used by the handler
297  */
298  virtual void
299  setInputCloud (const PointCloudConstPtr &cloud);
300 
301  protected:
302  /** \brief Class getName method. */
303  virtual std::string
304  getName () const { return ("PointCloudColorHandlerRGBField"); }
305 
306  private:
307  // Members derived from the base class
312  };
313 
314  //////////////////////////////////////////////////////////////////////////////////////
315  /** \brief HSV handler class for colors. Uses the data present in the "h", "s", "v"
316  * fields as the color at each point.
317  * \ingroup visualization
318  */
319  template <typename PointT>
321  {
323  typedef typename PointCloud::Ptr PointCloudPtr;
324  typedef typename PointCloud::ConstPtr PointCloudConstPtr;
325 
326  public:
327  typedef boost::shared_ptr<PointCloudColorHandlerHSVField<PointT> > Ptr;
328  typedef boost::shared_ptr<const PointCloudColorHandlerHSVField<PointT> > ConstPtr;
329 
330  /** \brief Constructor. */
332 
333  /** \brief Empty destructor */
335 
336  /** \brief Get the name of the field used. */
337  virtual std::string
338  getFieldName () const { return ("hsv"); }
339 
340  /** \brief Obtain the actual color for the input dataset as vtk scalars.
341  * \param[out] scalars the output scalars containing the color for the dataset
342  * \return true if the operation was successful (the handler is capable and
343  * the input cloud was given as a valid pointer), false otherwise
344  */
345  virtual bool
346  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
347 
348  protected:
349  /** \brief Class getName method. */
350  virtual std::string
351  getName () const { return ("PointCloudColorHandlerHSVField"); }
352 
353  /** \brief The field index for "S". */
355 
356  /** \brief The field index for "V". */
358  private:
359  // Members derived from the base class
364  };
365 
366  //////////////////////////////////////////////////////////////////////////////////////
367  /** \brief Generic field handler class for colors. Uses an user given field to extract
368  * 1D data and display the color at each point using a min-max lookup table.
369  * \author Radu B. Rusu
370  * \ingroup visualization
371  */
372  template <typename PointT>
374  {
376  typedef typename PointCloud::Ptr PointCloudPtr;
377  typedef typename PointCloud::ConstPtr PointCloudConstPtr;
378 
379  public:
380  typedef boost::shared_ptr<PointCloudColorHandlerGenericField<PointT> > Ptr;
381  typedef boost::shared_ptr<const PointCloudColorHandlerGenericField<PointT> > ConstPtr;
382 
383  /** \brief Constructor. */
384  PointCloudColorHandlerGenericField (const std::string &field_name)
385  : field_name_ (field_name)
386  {
387  capable_ = false;
388  }
389 
390  /** \brief Constructor. */
392  const std::string &field_name)
393  : PointCloudColorHandler<PointT> (cloud)
394  , field_name_ (field_name)
395  {
396  setInputCloud (cloud);
397  }
398 
399  /** \brief Destructor. */
401 
402  /** \brief Get the name of the field used. */
403  virtual std::string getFieldName () const { return (field_name_); }
404 
405  /** \brief Obtain the actual color for the input dataset as vtk scalars.
406  * \param[out] scalars the output scalars containing the color for the dataset
407  * \return true if the operation was successful (the handler is capable and
408  * the input cloud was given as a valid pointer), false otherwise
409  */
410  virtual bool
411  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
412 
413  /** \brief Set the input cloud to be used.
414  * \param[in] cloud the input cloud to be used by the handler
415  */
416  virtual void
417  setInputCloud (const PointCloudConstPtr &cloud);
418 
419  protected:
420  /** \brief Class getName method. */
421  virtual std::string
422  getName () const { return ("PointCloudColorHandlerGenericField"); }
423 
424  private:
429 
430  /** \brief Name of the field used to create the color handler. */
431  std::string field_name_;
432  };
433 
434 
435  //////////////////////////////////////////////////////////////////////////////////////
436  /** \brief RGBA handler class for colors. Uses the data present in the "rgba" field as
437  * the color at each point. Transparency is handled.
438  * \author Nizar Sallem
439  * \ingroup visualization
440  */
441  template <typename PointT>
443  {
445  typedef typename PointCloud::Ptr PointCloudPtr;
446  typedef typename PointCloud::ConstPtr PointCloudConstPtr;
447 
448  public:
449  typedef boost::shared_ptr<PointCloudColorHandlerRGBAField<PointT> > Ptr;
450  typedef boost::shared_ptr<const PointCloudColorHandlerRGBAField<PointT> > ConstPtr;
451 
452  /** \brief Constructor. */
454  {
455  capable_ = false;
456  }
457 
458  /** \brief Constructor. */
460  : PointCloudColorHandler<PointT> (cloud)
461  {
462  setInputCloud (cloud);
463  }
464 
465  /** \brief Destructor. */
467 
468  /** \brief Get the name of the field used. */
469  virtual std::string
470  getFieldName () const { return ("rgba"); }
471 
472  /** \brief Obtain the actual color for the input dataset as vtk scalars.
473  * \param[out] scalars the output scalars containing the color for the dataset
474  * \return true if the operation was successful (the handler is capable and
475  * the input cloud was given as a valid pointer), false otherwise
476  */
477  virtual bool
478  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
479 
480  /** \brief Set the input cloud to be used.
481  * \param[in] cloud the input cloud to be used by the handler
482  */
483  virtual void
484  setInputCloud (const PointCloudConstPtr &cloud);
485 
486  protected:
487  /** \brief Class getName method. */
488  virtual std::string
489  getName () const { return ("PointCloudColorHandlerRGBAField"); }
490 
491  private:
492  // Members derived from the base class
497  };
498 
499  //////////////////////////////////////////////////////////////////////////////////////
500  /** \brief Label field handler class for colors. Paints the points according to their
501  * labels, assigning a unique color from a predefined color lookup table to each label.
502  * \author Sergey Alexandrov
503  * \ingroup visualization
504  */
505  template <typename PointT>
507  {
509  typedef typename PointCloud::Ptr PointCloudPtr;
510  typedef typename PointCloud::ConstPtr PointCloudConstPtr;
511 
512  public:
513  typedef boost::shared_ptr<PointCloudColorHandlerLabelField<PointT> > Ptr;
514  typedef boost::shared_ptr<const PointCloudColorHandlerLabelField<PointT> > ConstPtr;
515 
516  /** \brief Constructor.
517  * \param[in] static_mapping Use a static colormapping from label_id to color (default true) */
518  PointCloudColorHandlerLabelField (const bool static_mapping = true)
520  {
521  capable_ = false;
522  static_mapping_ = static_mapping;
523  }
524 
525  /** \brief Constructor.
526  * \param[in] static_mapping Use a static colormapping from label_id to color (default true) */
528  const bool static_mapping = true)
529  : PointCloudColorHandler<PointT> (cloud)
530  {
531  setInputCloud (cloud);
532  static_mapping_ = static_mapping;
533  }
534 
535  /** \brief Destructor. */
537 
538  /** \brief Get the name of the field used. */
539  virtual std::string
540  getFieldName () const { return ("label"); }
541 
542  /** \brief Obtain the actual color for the input dataset as vtk scalars.
543  * \param[out] scalars the output scalars containing the color for the dataset
544  * \return true if the operation was successful (the handler is capable and
545  * the input cloud was given as a valid pointer), false otherwise
546  */
547  virtual bool
548  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
549 
550  /** \brief Set the input cloud to be used.
551  * \param[in] cloud the input cloud to be used by the handler
552  */
553  virtual void
554  setInputCloud (const PointCloudConstPtr &cloud);
555 
556  protected:
557  /** \brief Class getName method. */
558  virtual std::string
559  getName () const { return ("PointCloudColorHandlerLabelField"); }
560 
561  private:
562  // Members derived from the base class
567  bool static_mapping_;
568  };
569 
570  //////////////////////////////////////////////////////////////////////////////////////
571  /** \brief Base Handler class for PointCloud colors.
572  * \author Radu B. Rusu
573  * \ingroup visualization
574  */
575  template <>
577  {
578  public:
582 
583  typedef boost::shared_ptr<PointCloudColorHandler<PointCloud> > Ptr;
584  typedef boost::shared_ptr<const PointCloudColorHandler<PointCloud> > ConstPtr;
585 
586  /** \brief Constructor. */
588  cloud_ (cloud), capable_ (false), field_idx_ ()
589  {}
590 
591  /** \brief Destructor. */
593 
594  /** \brief Return whether this handler is capable of handling the input data or not. */
595  inline bool
596  isCapable () const { return (capable_); }
597 
598  /** \brief Abstract getName method. */
599  virtual std::string
600  getName () const = 0;
601 
602  /** \brief Abstract getFieldName method. */
603  virtual std::string
604  getFieldName () const = 0;
605 
606  /** \brief Obtain the actual color for the input dataset as vtk scalars.
607  * \param[out] scalars the output scalars containing the color for the dataset
608  * \return true if the operation was successful (the handler is capable and
609  * the input cloud was given as a valid pointer), false otherwise
610  */
611  virtual bool
612  getColor (vtkSmartPointer<vtkDataArray> &scalars) const = 0;
613 
614  /** \brief Set the input cloud to be used.
615  * \param[in] cloud the input cloud to be used by the handler
616  */
617  void
619  {
620  cloud_ = cloud;
621  }
622 
623  protected:
624  /** \brief A pointer to the input dataset. */
626 
627  /** \brief True if this handler is capable of handling the input data, false
628  * otherwise.
629  */
630  bool capable_;
631 
632  /** \brief The index of the field holding the data that represents the color. */
634  };
635 
636  //////////////////////////////////////////////////////////////////////////////////////
637  /** \brief Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)
638  * \author Radu B. Rusu
639  * \ingroup visualization
640  */
641  template <>
642  class PCL_EXPORTS PointCloudColorHandlerRandom<pcl::PCLPointCloud2> : public PointCloudColorHandler<pcl::PCLPointCloud2>
643  {
647 
648  public:
649  typedef boost::shared_ptr<PointCloudColorHandlerRandom<PointCloud> > Ptr;
650  typedef boost::shared_ptr<const PointCloudColorHandlerRandom<PointCloud> > ConstPtr;
651 
652  /** \brief Constructor. */
655  {
656  capable_ = true;
657  }
658 
659  /** \brief Empty destructor */
661 
662  /** \brief Get the name of the class. */
663  virtual std::string
664  getName () const { return ("PointCloudColorHandlerRandom"); }
665 
666  /** \brief Get the name of the field used. */
667  virtual std::string
668  getFieldName () const { return ("[random]"); }
669 
670  /** \brief Obtain the actual color for the input dataset as vtk scalars.
671  * \param[out] scalars the output scalars containing the color for the dataset
672  * \return true if the operation was successful (the handler is capable and
673  * the input cloud was given as a valid pointer), false otherwise
674  */
675  virtual bool
676  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
677  };
678 
679  //////////////////////////////////////////////////////////////////////////////////////
680  /** \brief Handler for predefined user colors. The color at each point will be drawn
681  * as the use given R, G, B values.
682  * \author Radu B. Rusu
683  * \ingroup visualization
684  */
685  template <>
686  class PCL_EXPORTS PointCloudColorHandlerCustom<pcl::PCLPointCloud2> : public PointCloudColorHandler<pcl::PCLPointCloud2>
687  {
691 
692  public:
693  /** \brief Constructor. */
695  double r, double g, double b) :
697  r_ (r), g_ (g), b_ (b)
698  {
699  capable_ = true;
700  }
701 
702  /** \brief Empty destructor */
704 
705  /** \brief Get the name of the class. */
706  virtual std::string
707  getName () const { return ("PointCloudColorHandlerCustom"); }
708 
709  /** \brief Get the name of the field used. */
710  virtual std::string
711  getFieldName () const { return (""); }
712 
713  /** \brief Obtain the actual color for the input dataset as vtk scalars.
714  * \param[out] scalars the output scalars containing the color for the dataset
715  * \return true if the operation was successful (the handler is capable and
716  * the input cloud was given as a valid pointer), false otherwise
717  */
718  virtual bool
719  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
720 
721  protected:
722  /** \brief Internal R, G, B holding the values given by the user. */
723  double r_, g_, b_;
724  };
725 
726  //////////////////////////////////////////////////////////////////////////////////////
727  /** \brief RGB handler class for colors. Uses the data present in the "rgb" or "rgba"
728  * fields as the color at each point.
729  * \author Radu B. Rusu
730  * \ingroup visualization
731  */
732  template <>
733  class PCL_EXPORTS PointCloudColorHandlerRGBField<pcl::PCLPointCloud2> : public PointCloudColorHandler<pcl::PCLPointCloud2>
734  {
738 
739  public:
740  typedef boost::shared_ptr<PointCloudColorHandlerRGBField<PointCloud> > Ptr;
741  typedef boost::shared_ptr<const PointCloudColorHandlerRGBField<PointCloud> > ConstPtr;
742 
743  /** \brief Constructor. */
745 
746  /** \brief Empty destructor */
748 
749  /** \brief Obtain the actual color for the input dataset as vtk scalars.
750  * \param[out] scalars the output scalars containing the color for the dataset
751  * \return true if the operation was successful (the handler is capable and
752  * the input cloud was given as a valid pointer), false otherwise
753  */
754  virtual bool
755  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
756 
757  protected:
758  /** \brief Get the name of the class. */
759  virtual std::string
760  getName () const { return ("PointCloudColorHandlerRGBField"); }
761 
762  /** \brief Get the name of the field used. */
763  virtual std::string
764  getFieldName () const { return ("rgb"); }
765  };
766 
767  //////////////////////////////////////////////////////////////////////////////////////
768  /** \brief HSV handler class for colors. Uses the data present in the "h", "s", "v"
769  * fields as the color at each point.
770  * \ingroup visualization
771  */
772  template <>
773  class PCL_EXPORTS PointCloudColorHandlerHSVField<pcl::PCLPointCloud2> : public PointCloudColorHandler<pcl::PCLPointCloud2>
774  {
778 
779  public:
780  typedef boost::shared_ptr<PointCloudColorHandlerHSVField<PointCloud> > Ptr;
781  typedef boost::shared_ptr<const PointCloudColorHandlerHSVField<PointCloud> > ConstPtr;
782 
783  /** \brief Constructor. */
785 
786  /** \brief Empty destructor */
788 
789  /** \brief Obtain the actual color for the input dataset as vtk scalars.
790  * \param[out] scalars the output scalars containing the color for the dataset
791  * \return true if the operation was successful (the handler is capable and
792  * the input cloud was given as a valid pointer), false otherwise
793  */
794  virtual bool
795  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
796 
797  protected:
798  /** \brief Get the name of the class. */
799  virtual std::string
800  getName () const { return ("PointCloudColorHandlerHSVField"); }
801 
802  /** \brief Get the name of the field used. */
803  virtual std::string
804  getFieldName () const { return ("hsv"); }
805 
806  /** \brief The field index for "S". */
808 
809  /** \brief The field index for "V". */
811  };
812 
813  //////////////////////////////////////////////////////////////////////////////////////
814  /** \brief Generic field handler class for colors. Uses an user given field to extract
815  * 1D data and display the color at each point using a min-max lookup table.
816  * \author Radu B. Rusu
817  * \ingroup visualization
818  */
819  template <>
820  class PCL_EXPORTS PointCloudColorHandlerGenericField<pcl::PCLPointCloud2> : public PointCloudColorHandler<pcl::PCLPointCloud2>
821  {
825 
826  public:
827  typedef boost::shared_ptr<PointCloudColorHandlerGenericField<PointCloud> > Ptr;
828  typedef boost::shared_ptr<const PointCloudColorHandlerGenericField<PointCloud> > ConstPtr;
829 
830  /** \brief Constructor. */
832  const std::string &field_name);
833 
834  /** \brief Empty destructor */
836 
837  /** \brief Obtain the actual color for the input dataset as vtk scalars.
838  * \param[out] scalars the output scalars containing the color for the dataset
839  * \return true if the operation was successful (the handler is capable and
840  * the input cloud was given as a valid pointer), false otherwise
841  */
842  virtual bool
843  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
844 
845  protected:
846  /** \brief Get the name of the class. */
847  virtual std::string
848  getName () const { return ("PointCloudColorHandlerGenericField"); }
849 
850  /** \brief Get the name of the field used. */
851  virtual std::string
852  getFieldName () const { return (field_name_); }
853 
854  private:
855  /** \brief Name of the field used to create the color handler. */
856  std::string field_name_;
857  };
858 
859  //////////////////////////////////////////////////////////////////////////////////////
860  /** \brief RGBA handler class for colors. Uses the data present in the "rgba" field as
861  * the color at each point. Transparency is handled.
862  * \author Nizar Sallem
863  * \ingroup visualization
864  */
865  template <>
866  class PCL_EXPORTS PointCloudColorHandlerRGBAField<pcl::PCLPointCloud2> : public PointCloudColorHandler<pcl::PCLPointCloud2>
867  {
871 
872  public:
873  typedef boost::shared_ptr<PointCloudColorHandlerRGBAField<PointCloud> > Ptr;
874  typedef boost::shared_ptr<const PointCloudColorHandlerRGBAField<PointCloud> > ConstPtr;
875 
876  /** \brief Constructor. */
878 
879  /** \brief Empty destructor */
881 
882  /** \brief Obtain the actual color for the input dataset as vtk scalars.
883  * \param[out] scalars the output scalars containing the color for the dataset
884  * \return true if the operation was successful (the handler is capable and
885  * the input cloud was given as a valid pointer), false otherwise
886  */
887  virtual bool
888  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
889 
890  protected:
891  /** \brief Get the name of the class. */
892  virtual std::string
893  getName () const { return ("PointCloudColorHandlerRGBAField"); }
894 
895  /** \brief Get the name of the field used. */
896  virtual std::string
897  getFieldName () const { return ("rgba"); }
898  };
899 
900  //////////////////////////////////////////////////////////////////////////////////////
901  /** \brief Label field handler class for colors. Paints the points according to their
902  * labels, assigning a unique color from a predefined color lookup table to each label.
903  * \author Sergey Alexandrov
904  * \ingroup visualization
905  */
906  template <>
907  class PCL_EXPORTS PointCloudColorHandlerLabelField<pcl::PCLPointCloud2> : public PointCloudColorHandler<pcl::PCLPointCloud2>
908  {
912 
913  public:
914  typedef boost::shared_ptr<PointCloudColorHandlerLabelField<PointCloud> > Ptr;
915  typedef boost::shared_ptr<const PointCloudColorHandlerLabelField<PointCloud> > ConstPtr;
916 
917  /** \brief Constructor.
918  * \param[in] static_mapping Use a static colormapping from label_id to color (default true) */
920  const bool static_mapping = true);
921 
922  /** \brief Empty destructor */
924 
925  /** \brief Obtain the actual color for the input dataset as vtk scalars.
926  * \param[out] scalars the output scalars containing the color for the dataset
927  * \return true if the operation was successful (the handler is capable and
928  * the input cloud was given as a valid pointer), false otherwise
929  */
930  virtual bool
931  getColor (vtkSmartPointer<vtkDataArray> &scalars) const;
932 
933  protected:
934  /** \brief Get the name of the class. */
935  virtual std::string
936  getName () const { return ("PointCloudColorHandlerLabelField"); }
937 
938  /** \brief Get the name of the field used. */
939  virtual std::string
940  getFieldName () const { return ("label"); }
941  private:
942  bool static_mapping_;
943  };
944 
945  }
946 }
947 
948 #include <pcl/visualization/impl/point_cloud_color_handlers.hpp>
949 
950 #endif // PCL_POINT_CLOUD_COLOR_HANDLERS_H_
951 
pcl::visualization::PointCloudColorHandlerLabelField::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerLabelField< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:514
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::field_idx_
int field_idx_
The index of the field holding the data that represents the color.
Definition: point_cloud_color_handlers.h:633
pcl::visualization::PointCloudColorHandlerLabelField< pcl::PCLPointCloud2 >::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerLabelField< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:915
pcl
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
pcl::visualization::PointCloudColorHandlerRandom::getName
virtual std::string getName() const
Abstract getName method.
Definition: point_cloud_color_handlers.h:164
pcl::visualization::PointCloudColorHandlerLabelField< pcl::PCLPointCloud2 >::Ptr
boost::shared_ptr< PointCloudColorHandlerLabelField< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:914
pcl::visualization::PointCloudColorHandlerGenericField::PointCloudColorHandlerGenericField
PointCloudColorHandlerGenericField(const PointCloudConstPtr &cloud, const std::string &field_name)
Constructor.
Definition: point_cloud_color_handlers.h:391
pcl::PointCloud::Ptr
boost::shared_ptr< PointCloud< PointT > > Ptr
Definition: point_cloud.h:428
pcl::visualization::PointCloudColorHandler::fields_
std::vector< pcl::PCLPointField > fields_
The list of fields available for this PointCloud.
Definition: point_cloud_color_handlers.h:129
pcl::visualization::PointCloudColorHandlerHSVField
HSV handler class for colors.
Definition: point_cloud_color_handlers.h:320
pcl::visualization::PointCloudColorHandlerRandom< pcl::PCLPointCloud2 >::~PointCloudColorHandlerRandom
virtual ~PointCloudColorHandlerRandom()
Empty destructor.
Definition: point_cloud_color_handlers.h:660
pcl::visualization::PointCloudColorHandlerRGBAField< pcl::PCLPointCloud2 >::getName
virtual std::string getName() const
Get the name of the class.
Definition: point_cloud_color_handlers.h:893
pcl::visualization::PointCloudColorHandler::setInputCloud
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
Definition: point_cloud_color_handlers.h:111
pcl::visualization::PointCloudColorHandlerRGBAField::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: point_cloud_color_handlers.hpp:456
pcl::visualization::PointCloudColorHandlerRandom< pcl::PCLPointCloud2 >::getName
virtual std::string getName() const
Get the name of the class.
Definition: point_cloud_color_handlers.h:664
pcl::visualization::PointCloudColorHandlerRGBField< pcl::PCLPointCloud2 >::getName
virtual std::string getName() const
Get the name of the class.
Definition: point_cloud_color_handlers.h:760
pcl::visualization::PointCloudColorHandler::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const =0
Obtain the actual color for the input dataset as vtk scalars.
pcl::visualization::PointCloudColorHandlerCustom
Handler for predefined user colors.
Definition: point_cloud_color_handlers.h:191
pcl::visualization::PointCloudColorHandlerRandom::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: point_cloud_color_handlers.hpp:77
pcl::visualization::PointCloudColorHandlerRandom
Handler for random PointCloud colors (i.e., R, G, B will be randomly chosen)
Definition: point_cloud_color_handlers.h:138
pcl::visualization::PointCloudColorHandlerRandom< pcl::PCLPointCloud2 >::Ptr
boost::shared_ptr< PointCloudColorHandlerRandom< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:649
pcl::visualization::PointCloudColorHandlerLabelField::Ptr
boost::shared_ptr< PointCloudColorHandlerLabelField< PointT > > Ptr
Definition: point_cloud_color_handlers.h:513
pcl::visualization::PointCloudColorHandler
Base Handler class for PointCloud colors.
Definition: point_cloud_color_handlers.h:64
pcl::visualization::PointCloudColorHandlerCustom::~PointCloudColorHandlerCustom
virtual ~PointCloudColorHandlerCustom()
Destructor.
Definition: point_cloud_color_handlers.h:223
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::Ptr
boost::shared_ptr< PointCloudColorHandler< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:583
pcl::visualization::PointCloudColorHandler::PointCloudColorHandler
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
Definition: point_cloud_color_handlers.h:80
pcl::visualization::PointCloudColorHandlerRandom< pcl::PCLPointCloud2 >::PointCloudColorHandlerRandom
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
Definition: point_cloud_color_handlers.h:653
pcl::visualization::PointCloudColorHandlerCustom< pcl::PCLPointCloud2 >::PointCloudColorHandlerCustom
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
Definition: point_cloud_color_handlers.h:694
pcl::visualization::PointCloudColorHandlerHSVField::Ptr
boost::shared_ptr< PointCloudColorHandlerHSVField< PointT > > Ptr
Definition: point_cloud_color_handlers.h:327
pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:781
pcl::visualization::PointCloudColorHandlerLabelField::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: point_cloud_color_handlers.hpp:524
pcl::visualization::PointCloudColorHandler::PointCloud
pcl::PointCloud< PointT > PointCloud
Definition: point_cloud_color_handlers.h:67
pcl::visualization::PointCloudColorHandlerCustom::Ptr
boost::shared_ptr< PointCloudColorHandlerCustom< PointT > > Ptr
Definition: point_cloud_color_handlers.h:198
pcl::visualization::PointCloudColorHandler::getName
virtual std::string getName() const =0
Abstract getName method.
pcl::visualization::PointCloudColorHandlerCustom::getName
virtual std::string getName() const
Abstract getName method.
Definition: point_cloud_color_handlers.h:227
pcl::visualization::PointCloudColorHandlerRandom< pcl::PCLPointCloud2 >::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRandom< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:650
pcl::visualization::PointCloudColorHandlerRGBAField::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRGBAField< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:450
pcl::visualization::PointCloudColorHandlerCustom::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:231
pcl::visualization::PointCloudColorHandlerHSVField::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:338
pcl::visualization::PointCloudColorHandlerGenericField::getName
virtual std::string getName() const
Class getName method.
Definition: point_cloud_color_handlers.h:422
pcl::visualization::PointCloudColorHandlerRGBField< pcl::PCLPointCloud2 >::Ptr
boost::shared_ptr< PointCloudColorHandlerRGBField< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:740
pcl::PointCloud
PointCloud represents the base class in PCL for storing collections of 3D points.
Definition: projection_matrix.h:53
pcl::visualization::PointCloudColorHandlerRGBField::Ptr
boost::shared_ptr< PointCloudColorHandlerRGBField< PointT > > Ptr
Definition: point_cloud_color_handlers.h:264
pcl::visualization::PointCloudColorHandlerGenericField::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:403
pcl::visualization::PointCloudColorHandlerRandom::Ptr
boost::shared_ptr< PointCloudColorHandlerRandom< PointT > > Ptr
Definition: point_cloud_color_handlers.h:145
pcl::visualization::PointCloudColorHandler::~PointCloudColorHandler
virtual ~PointCloudColorHandler()
Destructor.
Definition: point_cloud_color_handlers.h:85
pcl::visualization::PointCloudColorHandlerRGBField::setInputCloud
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
Definition: point_cloud_color_handlers.hpp:111
pcl::visualization::PointCloudColorHandlerGenericField::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:381
pcl::visualization::PointCloudColorHandlerCustom< pcl::PCLPointCloud2 >::r_
double r_
Internal R, G, B holding the values given by the user.
Definition: point_cloud_color_handlers.h:723
pcl::PointXYZRGB
A point structure representing Euclidean xyz coordinates, and the RGB color.
Definition: point_types.hpp:619
pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >::v_field_idx_
int v_field_idx_
The field index for "V".
Definition: point_cloud_color_handlers.h:810
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::setInputCloud
void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
Definition: point_cloud_color_handlers.h:618
pcl::visualization::PointCloudColorHandlerGenericField::setInputCloud
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
Definition: point_cloud_color_handlers.hpp:368
pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >::Ptr
boost::shared_ptr< PointCloudColorHandlerHSVField< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:780
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::isCapable
bool isCapable() const
Return whether this handler is capable of handling the input data or not.
Definition: point_cloud_color_handlers.h:596
pcl::visualization::PointCloudColorHandlerRGBField< pcl::PCLPointCloud2 >::~PointCloudColorHandlerRGBField
virtual ~PointCloudColorHandlerRGBField()
Empty destructor.
Definition: point_cloud_color_handlers.h:747
pcl::visualization::PointCloudColorHandlerLabelField::PointCloudColorHandlerLabelField
PointCloudColorHandlerLabelField(const bool static_mapping=true)
Constructor.
Definition: point_cloud_color_handlers.h:518
pcl::visualization::PointCloudColorHandlerCustom::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerCustom< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:199
pcl::visualization::PointCloudColorHandlerRGBField::~PointCloudColorHandlerRGBField
virtual ~PointCloudColorHandlerRGBField()
Destructor.
Definition: point_cloud_color_handlers.h:281
pcl::visualization::PointCloudColorHandler::cloud_
PointCloudConstPtr cloud_
A pointer to the input dataset.
Definition: point_cloud_color_handlers.h:118
pcl::visualization::PointCloudColorHandlerCustom::b_
double b_
Definition: point_cloud_color_handlers.h:247
pcl::visualization::PointCloudColorHandler::Ptr
boost::shared_ptr< PointCloudColorHandler< PointT > > Ptr
Definition: point_cloud_color_handlers.h:71
pcl::visualization::PointCloudColorHandlerCustom::PointCloudColorHandlerCustom
PointCloudColorHandlerCustom(const PointCloudConstPtr &cloud, double r, double g, double b)
Constructor.
Definition: point_cloud_color_handlers.h:212
pcl::visualization::PointCloudColorHandlerHSVField::PointCloudColorHandlerHSVField
PointCloudColorHandlerHSVField(const PointCloudConstPtr &cloud)
Constructor.
Definition: point_cloud_color_handlers.hpp:199
pcl::visualization::PointCloudColorHandlerRGBAField::Ptr
boost::shared_ptr< PointCloudColorHandlerRGBAField< PointT > > Ptr
Definition: point_cloud_color_handlers.h:449
pcl::visualization::PointCloudColorHandler::capable_
bool capable_
True if this handler is capable of handling the input data, false otherwise.
Definition: point_cloud_color_handlers.h:123
pcl::visualization::PointCloudColorHandlerGenericField::~PointCloudColorHandlerGenericField
virtual ~PointCloudColorHandlerGenericField()
Destructor.
Definition: point_cloud_color_handlers.h:400
pcl::visualization::PointCloudColorHandlerGenericField< pcl::PCLPointCloud2 >::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerGenericField< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:828
pcl::visualization::PointCloudColorHandlerCustom< pcl::PCLPointCloud2 >::~PointCloudColorHandlerCustom
virtual ~PointCloudColorHandlerCustom()
Empty destructor.
Definition: point_cloud_color_handlers.h:703
pcl::visualization::PointCloudColorHandlerRGBAField::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:470
pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >::getName
virtual std::string getName() const
Get the name of the class.
Definition: point_cloud_color_handlers.h:800
pcl::visualization::PointCloudColorHandlerRGBAField< pcl::PCLPointCloud2 >::~PointCloudColorHandlerRGBAField
virtual ~PointCloudColorHandlerRGBAField()
Empty destructor.
Definition: point_cloud_color_handlers.h:880
pcl::visualization::PointCloudColorHandlerRGBAField::setInputCloud
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
Definition: point_cloud_color_handlers.hpp:442
pcl::visualization::PointCloudColorHandlerRGBField::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:265
pcl::visualization::PointCloudColorHandlerRGBAField
RGBA handler class for colors.
Definition: point_cloud_color_handlers.h:442
pcl::visualization::PointCloudColorHandlerRGBField::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:285
pcl::visualization::PointCloudColorHandlerLabelField::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:540
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::~PointCloudColorHandler
virtual ~PointCloudColorHandler()
Destructor.
Definition: point_cloud_color_handlers.h:592
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::cloud_
PointCloudConstPtr cloud_
A pointer to the input dataset.
Definition: point_cloud_color_handlers.h:625
pcl::visualization::PointCloudColorHandlerGenericField< pcl::PCLPointCloud2 >::getName
virtual std::string getName() const
Get the name of the class.
Definition: point_cloud_color_handlers.h:848
pcl::visualization::PointCloudColorHandlerLabelField::~PointCloudColorHandlerLabelField
virtual ~PointCloudColorHandlerLabelField()
Destructor.
Definition: point_cloud_color_handlers.h:536
pcl::visualization::PointCloudColorHandlerRGBField::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: point_cloud_color_handlers.hpp:134
pcl::visualization::PointCloudColorHandlerLabelField
Label field handler class for colors.
Definition: point_cloud_color_handlers.h:506
pcl::visualization::PointCloudColorHandlerRGBField::getName
virtual std::string getName() const
Class getName method.
Definition: point_cloud_color_handlers.h:304
pcl::visualization::PointCloudColorHandlerCustom::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: point_cloud_color_handlers.hpp:49
pcl::visualization::PointCloudColorHandlerRGBField< pcl::PCLPointCloud2 >::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:764
pcl::visualization::PointCloudColorHandler::ConstPtr
boost::shared_ptr< const PointCloudColorHandler< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:72
pcl::visualization::PointCloudColorHandlerRandom::PointCloudColorHandlerRandom
PointCloudColorHandlerRandom(const PointCloudConstPtr &cloud)
Constructor.
Definition: point_cloud_color_handlers.h:156
pcl::visualization::PointCloudColorHandler::PointCloudColorHandler
PointCloudColorHandler()
Constructor.
Definition: point_cloud_color_handlers.h:75
pcl::visualization::PointCloudColorHandlerGenericField::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: point_cloud_color_handlers.hpp:381
pcl::visualization::PointCloudColorHandlerRGBField::PointCloudColorHandlerRGBField
PointCloudColorHandlerRGBField(const PointCloudConstPtr &cloud)
Constructor.
Definition: point_cloud_color_handlers.h:274
pcl::visualization::PointCloudColorHandlerCustom::g_
double g_
Definition: point_cloud_color_handlers.h:247
pcl::visualization::PointCloudColorHandler::getFieldName
virtual std::string getFieldName() const =0
Abstract getFieldName method.
pcl::PCLPointCloud2
Definition: PCLPointCloud2.h:20
pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >::s_field_idx_
int s_field_idx_
The field index for "S".
Definition: point_cloud_color_handlers.h:807
pcl::visualization::PointCloudColorHandlerGenericField::Ptr
boost::shared_ptr< PointCloudColorHandlerGenericField< PointT > > Ptr
Definition: point_cloud_color_handlers.h:380
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::ConstPtr
boost::shared_ptr< const PointCloudColorHandler< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:584
pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >::~PointCloudColorHandlerHSVField
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
Definition: point_cloud_color_handlers.h:787
pcl::visualization::PointCloudColorHandlerLabelField< pcl::PCLPointCloud2 >::getName
virtual std::string getName() const
Get the name of the class.
Definition: point_cloud_color_handlers.h:936
pcl::visualization::PointCloudColorHandlerLabelField::setInputCloud
virtual void setInputCloud(const PointCloudConstPtr &cloud)
Set the input cloud to be used.
Definition: point_cloud_color_handlers.hpp:511
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::PointCloud
pcl::PCLPointCloud2 PointCloud
Definition: point_cloud_color_handlers.h:579
pcl::visualization::PointCloudColorHandlerRGBField::PointCloudColorHandlerRGBField
PointCloudColorHandlerRGBField()
Constructor.
Definition: point_cloud_color_handlers.h:268
pcl::visualization::PointCloudColorHandlerGenericField::PointCloudColorHandlerGenericField
PointCloudColorHandlerGenericField(const std::string &field_name)
Constructor.
Definition: point_cloud_color_handlers.h:384
pcl::visualization::PointCloudColorHandlerRGBAField::PointCloudColorHandlerRGBAField
PointCloudColorHandlerRGBAField()
Constructor.
Definition: point_cloud_color_handlers.h:453
pcl::visualization::PointCloudColorHandlerCustom::r_
double r_
Internal R, G, B holding the values given by the user.
Definition: point_cloud_color_handlers.h:247
pcl::visualization::PointCloudColorHandlerRGBAField::PointCloudColorHandlerRGBAField
PointCloudColorHandlerRGBAField(const PointCloudConstPtr &cloud)
Constructor.
Definition: point_cloud_color_handlers.h:459
pcl::visualization::PointCloudColorHandlerRGBAField< pcl::PCLPointCloud2 >::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRGBAField< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:874
pcl::PointCloud::ConstPtr
boost::shared_ptr< const PointCloud< PointT > > ConstPtr
Definition: point_cloud.h:429
pcl::visualization::PointCloudColorHandlerCustom< pcl::PCLPointCloud2 >::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:711
pcl::visualization::PointCloudColorHandler::PointCloudConstPtr
PointCloud::ConstPtr PointCloudConstPtr
Definition: point_cloud_color_handlers.h:69
pcl::visualization::PointCloudColorHandlerRGBField
RGB handler class for colors.
Definition: point_cloud_color_handlers.h:257
pcl::visualization::PointCloudColorHandlerRandom::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRandom< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:146
pcl::visualization::PointCloudColorHandlerRGBAField< pcl::PCLPointCloud2 >::Ptr
boost::shared_ptr< PointCloudColorHandlerRGBAField< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:873
pcl::visualization::PointCloudColorHandlerHSVField< pcl::PCLPointCloud2 >::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:804
pcl::visualization::PointCloudColorHandlerHSVField::~PointCloudColorHandlerHSVField
virtual ~PointCloudColorHandlerHSVField()
Empty destructor.
Definition: point_cloud_color_handlers.h:334
pcl::PCLPointCloud2::ConstPtr
boost::shared_ptr< ::pcl::PCLPointCloud2 const > ConstPtr
Definition: PCLPointCloud2.h:52
pcl::visualization::PointCloudColorHandlerRGBField< pcl::PCLPointCloud2 >::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerRGBField< PointCloud > > ConstPtr
Definition: point_cloud_color_handlers.h:741
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::capable_
bool capable_
True if this handler is capable of handling the input data, false otherwise.
Definition: point_cloud_color_handlers.h:630
pcl::visualization::PointCloudColorHandlerCustom::PointCloudColorHandlerCustom
PointCloudColorHandlerCustom(double r, double g, double b)
Constructor.
Definition: point_cloud_color_handlers.h:202
pcl::visualization::PointCloudColorHandlerGenericField< pcl::PCLPointCloud2 >::~PointCloudColorHandlerGenericField
virtual ~PointCloudColorHandlerGenericField()
Empty destructor.
Definition: point_cloud_color_handlers.h:835
pcl::visualization::PointCloudColorHandlerHSVField::v_field_idx_
int v_field_idx_
The field index for "V".
Definition: point_cloud_color_handlers.h:357
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::PointCloudConstPtr
PointCloud::ConstPtr PointCloudConstPtr
Definition: point_cloud_color_handlers.h:581
pcl::visualization::PointCloudColorHandlerLabelField< pcl::PCLPointCloud2 >::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:940
pcl::visualization::PointCloudColorHandlerGenericField< pcl::PCLPointCloud2 >::Ptr
boost::shared_ptr< PointCloudColorHandlerGenericField< PointCloud > > Ptr
Definition: point_cloud_color_handlers.h:827
pcl::visualization::PointCloudColorHandlerLabelField::PointCloudColorHandlerLabelField
PointCloudColorHandlerLabelField(const PointCloudConstPtr &cloud, const bool static_mapping=true)
Constructor.
Definition: point_cloud_color_handlers.h:527
pcl::visualization::PointCloudColorHandlerRandom::PointCloudColorHandlerRandom
PointCloudColorHandlerRandom()
Constructor.
Definition: point_cloud_color_handlers.h:149
pcl::visualization::PointCloudColorHandlerLabelField::getName
virtual std::string getName() const
Class getName method.
Definition: point_cloud_color_handlers.h:559
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::PointCloudColorHandler
PointCloudColorHandler(const PointCloudConstPtr &cloud)
Constructor.
Definition: point_cloud_color_handlers.h:587
pcl::visualization::PointCloudColorHandler::isCapable
bool isCapable() const
Check if this handler is capable of handling the input data or not.
Definition: point_cloud_color_handlers.h:89
pcl::visualization::PointCloudColorHandlerRGBAField::getName
virtual std::string getName() const
Class getName method.
Definition: point_cloud_color_handlers.h:489
pcl::visualization::PointCloudColorHandlerRandom::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:168
pcl::visualization::PointCloudColorHandler::PointCloudPtr
PointCloud::Ptr PointCloudPtr
Definition: point_cloud_color_handlers.h:68
pcl::visualization::PointCloudColorHandlerGenericField< pcl::PCLPointCloud2 >::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:852
pcl::visualization::PointCloudColorHandlerRGBAField< pcl::PCLPointCloud2 >::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:897
pcl::visualization::PointCloudColorHandlerCustom< pcl::PCLPointCloud2 >::getName
virtual std::string getName() const
Get the name of the class.
Definition: point_cloud_color_handlers.h:707
pcl::visualization::PointCloudColorHandlerHSVField::s_field_idx_
int s_field_idx_
The field index for "S".
Definition: point_cloud_color_handlers.h:354
pcl::visualization::PointCloudColorHandlerRandom< pcl::PCLPointCloud2 >::getFieldName
virtual std::string getFieldName() const
Get the name of the field used.
Definition: point_cloud_color_handlers.h:668
pcl::visualization::PointCloudColorHandlerHSVField::getName
virtual std::string getName() const
Class getName method.
Definition: point_cloud_color_handlers.h:351
pcl::visualization::PointCloudColorHandlerHSVField::ConstPtr
boost::shared_ptr< const PointCloudColorHandlerHSVField< PointT > > ConstPtr
Definition: point_cloud_color_handlers.h:328
pcl::visualization::PointCloudColorHandlerGenericField
Generic field handler class for colors.
Definition: point_cloud_color_handlers.h:373
pcl::visualization::PointCloudColorHandler< pcl::PCLPointCloud2 >::PointCloudPtr
PointCloud::Ptr PointCloudPtr
Definition: point_cloud_color_handlers.h:580
vtkSmartPointer
Definition: actor_map.h:50
pcl::visualization::PointCloudColorHandlerLabelField< pcl::PCLPointCloud2 >::~PointCloudColorHandlerLabelField
virtual ~PointCloudColorHandlerLabelField()
Empty destructor.
Definition: point_cloud_color_handlers.h:923
pcl::visualization::PointCloudColorHandler::field_idx_
int field_idx_
The index of the field holding the data that represents the color.
Definition: point_cloud_color_handlers.h:126
pcl::visualization::PointCloudColorHandlerHSVField::getColor
virtual bool getColor(vtkSmartPointer< vtkDataArray > &scalars) const
Obtain the actual color for the input dataset as vtk scalars.
Definition: point_cloud_color_handlers.hpp:230
pcl::PCLPointCloud2::Ptr
boost::shared_ptr< ::pcl::PCLPointCloud2 > Ptr
Definition: PCLPointCloud2.h:51
pcl::visualization::PointCloudColorHandlerRGBAField::~PointCloudColorHandlerRGBAField
virtual ~PointCloudColorHandlerRGBAField()
Destructor.
Definition: point_cloud_color_handlers.h:466