Point Cloud Library (PCL)  1.7.0
point_types.hpp
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010, Willow Garage, Inc.
6  * Copyright (c) 2012-, Open Perception, Inc.
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  *
14  * * Redistributions of source code must retain the above copyright
15  * notice, this list of conditions and the following disclaimer.
16  * * Redistributions in binary form must reproduce the above
17  * copyright notice, this list of conditions and the following
18  * disclaimer in the documentation and/or other materials provided
19  * with the distribution.
20  * * Neither the name of the copyright holder(s) nor the names of its
21  * contributors may be used to endorse or promote products derived
22  * from this software without specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35  * POSSIBILITY OF SUCH DAMAGE.
36  *
37  */
38 
39 #ifndef PCL_IMPL_POINT_TYPES_HPP_
40 #define PCL_IMPL_POINT_TYPES_HPP_
41 
42 #if defined __GNUC__
43 # pragma GCC system_header
44 #endif
45 
46 #include <Eigen/Core>
47 #include <ostream>
48 
49 // Define all PCL point types
50 #define PCL_POINT_TYPES \
51  (pcl::PointXYZ) \
52  (pcl::PointXYZI) \
53  (pcl::PointXYZL) \
54  (pcl::Label) \
55  (pcl::PointXYZRGBA) \
56  (pcl::PointXYZRGB) \
57  (pcl::PointXYZRGBL) \
58  (pcl::PointXYZHSV) \
59  (pcl::PointXY) \
60  (pcl::InterestPoint) \
61  (pcl::Axis) \
62  (pcl::Normal) \
63  (pcl::PointNormal) \
64  (pcl::PointXYZRGBNormal) \
65  (pcl::PointXYZINormal) \
66  (pcl::PointWithRange) \
67  (pcl::PointWithViewpoint) \
68  (pcl::MomentInvariants) \
69  (pcl::PrincipalRadiiRSD) \
70  (pcl::Boundary) \
71  (pcl::PrincipalCurvatures) \
72  (pcl::PFHSignature125) \
73  (pcl::PFHRGBSignature250) \
74  (pcl::PPFSignature) \
75  (pcl::PPFRGBSignature) \
76  (pcl::NormalBasedSignature12) \
77  (pcl::FPFHSignature33) \
78  (pcl::VFHSignature308) \
79  (pcl::ESFSignature640) \
80  (pcl::Narf36) \
81  (pcl::IntensityGradient) \
82  (pcl::PointWithScale) \
83  (pcl::PointSurfel) \
84  (pcl::ShapeContext1980) \
85  (pcl::SHOT352) \
86  (pcl::SHOT1344) \
87  (pcl::PointUV) \
88  (pcl::ReferenceFrame)
89 
90 // Define all point types that include RGB data
91 #define PCL_RGB_POINT_TYPES \
92  (pcl::PointXYZRGBA) \
93  (pcl::PointXYZRGB) \
94  (pcl::PointXYZRGBL) \
95  (pcl::PointXYZRGBNormal) \
96  (pcl::PointSurfel) \
97 
98 // Define all point types that include XYZ data
99 #define PCL_XYZ_POINT_TYPES \
100  (pcl::PointXYZ) \
101  (pcl::PointXYZI) \
102  (pcl::PointXYZL) \
103  (pcl::PointXYZRGBA) \
104  (pcl::PointXYZRGB) \
105  (pcl::PointXYZRGBL) \
106  (pcl::PointXYZHSV) \
107  (pcl::InterestPoint) \
108  (pcl::PointNormal) \
109  (pcl::PointXYZRGBNormal) \
110  (pcl::PointXYZINormal) \
111  (pcl::PointWithRange) \
112  (pcl::PointWithViewpoint) \
113  (pcl::PointWithScale) \
114  (pcl::PointSurfel)
115 
116 // Define all point types with XYZ and label
117 #define PCL_XYZL_POINT_TYPES \
118  (pcl::PointXYZL) \
119  (pcl::PointXYZRGBL)
120 
121 // Define all point types that include normal[3] data
122 #define PCL_NORMAL_POINT_TYPES \
123  (pcl::Normal) \
124  (pcl::PointNormal) \
125  (pcl::PointXYZRGBNormal) \
126  (pcl::PointXYZINormal) \
127  (pcl::PointSurfel)
128 
129 // Define all point types that represent features
130 #define PCL_FEATURE_POINT_TYPES \
131  (pcl::PFHSignature125) \
132  (pcl::PFHRGBSignature250) \
133  (pcl::PPFSignature) \
134  (pcl::PPFRGBSignature) \
135  (pcl::NormalBasedSignature12) \
136  (pcl::FPFHSignature33) \
137  (pcl::VFHSignature308) \
138  (pcl::ESFSignature640) \
139  (pcl::Narf36)
140 
141 namespace pcl
142 {
143 
144 #define PCL_ADD_POINT4D \
145  union EIGEN_ALIGN16 { \
146  float data[4]; \
147  struct { \
148  float x; \
149  float y; \
150  float z; \
151  }; \
152  }; \
153  inline Eigen::Map<Eigen::Vector3f> getVector3fMap () { return (Eigen::Vector3f::Map (data)); } \
154  inline const Eigen::Map<const Eigen::Vector3f> getVector3fMap () const { return (Eigen::Vector3f::Map (data)); } \
155  inline Eigen::Map<Eigen::Vector4f, Eigen::Aligned> getVector4fMap () { return (Eigen::Vector4f::MapAligned (data)); } \
156  inline const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned> getVector4fMap () const { return (Eigen::Vector4f::MapAligned (data)); } \
157  inline Eigen::Map<Eigen::Array3f> getArray3fMap () { return (Eigen::Array3f::Map (data)); } \
158  inline const Eigen::Map<const Eigen::Array3f> getArray3fMap () const { return (Eigen::Array3f::Map (data)); } \
159  inline Eigen::Map<Eigen::Array4f, Eigen::Aligned> getArray4fMap () { return (Eigen::Array4f::MapAligned (data)); } \
160  inline const Eigen::Map<const Eigen::Array4f, Eigen::Aligned> getArray4fMap () const { return (Eigen::Array4f::MapAligned (data)); }
161 
162 #define PCL_ADD_NORMAL4D \
163  union EIGEN_ALIGN16 { \
164  float data_n[4]; \
165  float normal[3]; \
166  struct { \
167  float normal_x; \
168  float normal_y; \
169  float normal_z; \
170  }; \
171  }; \
172  inline Eigen::Map<Eigen::Vector3f> getNormalVector3fMap () { return (Eigen::Vector3f::Map (data_n)); } \
173  inline const Eigen::Map<const Eigen::Vector3f> getNormalVector3fMap () const { return (Eigen::Vector3f::Map (data_n)); } \
174  inline Eigen::Map<Eigen::Vector4f, Eigen::Aligned> getNormalVector4fMap () { return (Eigen::Vector4f::MapAligned (data_n)); } \
175  inline const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned> getNormalVector4fMap () const { return (Eigen::Vector4f::MapAligned (data_n)); }
176 
177 #define PCL_ADD_RGB \
178  union \
179  { \
180  union \
181  { \
182  struct \
183  { \
184  uint8_t b; \
185  uint8_t g; \
186  uint8_t r; \
187  uint8_t a; \
188  }; \
189  float rgb; \
190  }; \
191  uint32_t rgba; \
192  };
193 
194 #define PCL_ADD_INTENSITY \
195  struct \
196  { \
197  float intensity; \
198  }; \
199 
200 #define PCL_ADD_INTENSITY_8U \
201  struct \
202  { \
203  uint8_t intensity; \
204  }; \
205 
206 #define PCL_ADD_INTENSITY_32U \
207  struct \
208  { \
209  uint32_t intensity; \
210  }; \
211 
212  typedef Eigen::Map<Eigen::Array3f> Array3fMap;
213  typedef const Eigen::Map<const Eigen::Array3f> Array3fMapConst;
214  typedef Eigen::Map<Eigen::Array4f, Eigen::Aligned> Array4fMap;
215  typedef const Eigen::Map<const Eigen::Array4f, Eigen::Aligned> Array4fMapConst;
216  typedef Eigen::Map<Eigen::Vector3f> Vector3fMap;
217  typedef const Eigen::Map<const Eigen::Vector3f> Vector3fMapConst;
218  typedef Eigen::Map<Eigen::Vector4f, Eigen::Aligned> Vector4fMap;
219  typedef const Eigen::Map<const Eigen::Vector4f, Eigen::Aligned> Vector4fMapConst;
220 
221 
222  struct _PointXYZ
223  {
224  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
225 
226  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
227  };
228 
229  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZ& p);
230  /** \brief A point structure representing Euclidean xyz coordinates. (SSE friendly)
231  * \ingroup common
232  */
234  {
235  inline PointXYZ (const _PointXYZ &p)
236  {
237  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
238  }
239 
240  inline PointXYZ ()
241  {
242  x = y = z = 0.0f;
243  data[3] = 1.0f;
244  }
245 
246  inline PointXYZ (float _x, float _y, float _z)
247  {
248  x = _x; y = _y; z = _z;
249  data[3] = 1.0f;
250  }
251 
252  friend std::ostream& operator << (std::ostream& os, const PointXYZ& p);
253  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
254  };
255 
256 
257 #ifdef RGB
258 #undef RGB
259 #endif
260  struct _RGB
261  {
263  };
264 
265  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const RGB& p);
266  /** \brief A structure representing RGB color information.
267  *
268  * The RGBA information is available either as separate r, g, b, or as a
269  * packed uint32_t rgba value. To pack it, use:
270  *
271  * \code
272  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
273  * \endcode
274  *
275  * To unpack it use:
276  *
277  * \code
278  * int rgb = ...;
279  * uint8_t r = (rgb >> 16) & 0x0000ff;
280  * uint8_t g = (rgb >> 8) & 0x0000ff;
281  * uint8_t b = (rgb) & 0x0000ff;
282  * \endcode
283  *
284  */
285  struct RGB: public _RGB
286  {
287  inline RGB (const _RGB &p)
288  {
289  rgba = p.rgba;
290  }
291 
292  inline RGB ()
293  {
294  r = g = b = a = 0;
295  }
296 
297  friend std::ostream& operator << (std::ostream& os, const RGB& p);
298  };
299 
300 
301  struct _Intensity
302  {
304  };
305 
306  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity& p);
307  /** \brief A point structure representing the grayscale intensity in single-channel images.
308  * Intensity is represented as a float value.
309  * \ingroup common
310  */
311  struct Intensity: public _Intensity
312  {
313  inline Intensity (const _Intensity &p)
314  {
315  intensity = p.intensity;
316  }
317 
318  inline Intensity ()
319  {
320  intensity = 0.0f;
321  }
322 
323  friend std::ostream& operator << (std::ostream& os, const Intensity& p);
324  };
325 
326 
328  {
330  };
331 
332  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity8u& p);
333  /** \brief A point structure representing the grayscale intensity in single-channel images.
334  * Intensity is represented as a uint8_t value.
335  * \ingroup common
336  */
337  struct Intensity8u: public _Intensity8u
338  {
339  inline Intensity8u (const _Intensity8u &p)
340  {
341  intensity = p.intensity;
342  }
343 
344  inline Intensity8u ()
345  {
346  intensity = 0;
347  }
348 
349  friend std::ostream& operator << (std::ostream& os, const Intensity8u& p);
350  };
351 
353  {
355  };
356 
357  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Intensity32u& p);
358  /** \brief A point structure representing the grayscale intensity in single-channel images.
359  * Intensity is represented as a uint8_t value.
360  * \ingroup common
361  */
363  {
364  inline Intensity32u (const _Intensity32u &p)
365  {
366  intensity = p.intensity;
367  }
368 
369  inline Intensity32u ()
370  {
371  intensity = 0;
372  }
373 
374  friend std::ostream& operator << (std::ostream& os, const Intensity32u& p);
375  };
376 
377  /** \brief A point structure representing Euclidean xyz coordinates, and the intensity value.
378  * \ingroup common
379  */
381  {
382  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
383  union
384  {
385  struct
386  {
387  float intensity;
388  };
389  float data_c[4];
390  };
391  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
392  };
393 
394  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZI& p);
395  struct PointXYZI : public _PointXYZI
396  {
397  inline PointXYZI (const _PointXYZI &p)
398  {
399  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
400  intensity = p.intensity;
401  }
402 
403  inline PointXYZI ()
404  {
405  x = y = z = 0.0f;
406  data[3] = 1.0f;
407  intensity = 0.0f;
408  }
409  inline PointXYZI (float _intensity)
410  {
411  x = y = z = 0.0f;
412  data[3] = 1.0f;
413  intensity = _intensity;
414  }
415  friend std::ostream& operator << (std::ostream& os, const PointXYZI& p);
416  };
417 
418 
420  {
421  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
422  uint32_t label;
423  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
424  };
425 
426  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZL& p);
427  struct PointXYZL : public _PointXYZL
428  {
429  inline PointXYZL (const _PointXYZL &p)
430  {
431  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
432  label = p.label;
433  }
434 
435  inline PointXYZL ()
436  {
437  x = y = z = 0.0f;
438  data[3] = 1.0f;
439  label = 0;
440  }
441 
442  friend std::ostream& operator << (std::ostream& os, const PointXYZL& p);
443  };
444 
445 
446  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Label& p);
447  struct Label
448  {
449  uint32_t label;
450 
451  friend std::ostream& operator << (std::ostream& os, const Label& p);
452  };
453 
454 
456  {
457  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
459  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
460  };
461 
462  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
463  /** \brief A point structure representing Euclidean xyz coordinates, and the RGBA color.
464  *
465  * The RGBA information is available either as separate r, g, b, or as a
466  * packed uint32_t rgba value. To pack it, use:
467  *
468  * \code
469  * int rgb = ((int)r) << 16 | ((int)g) << 8 | ((int)b);
470  * \endcode
471  *
472  * To unpack it use:
473  *
474  * \code
475  * int rgb = ...;
476  * uint8_t r = (rgb >> 16) & 0x0000ff;
477  * uint8_t g = (rgb >> 8) & 0x0000ff;
478  * uint8_t b = (rgb) & 0x0000ff;
479  * \endcode
480  *
481  * \ingroup common
482  */
484  {
485  inline PointXYZRGBA (const _PointXYZRGBA &p)
486  {
487  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
488  rgba = p.rgba;
489  }
490 
491  inline PointXYZRGBA ()
492  {
493  x = y = z = 0.0f;
494  data[3] = 1.0f;
495  r = g = b = a = 0;
496  }
497  inline Eigen::Vector3i getRGBVector3i ()
498  {
499  return (Eigen::Vector3i (r, g, b));
500  }
501  inline const Eigen::Vector3i getRGBVector3i () const { return (Eigen::Vector3i (r, g, b)); }
502  inline Eigen::Vector4i getRGBVector4i ()
503  {
504  return (Eigen::Vector4i (r, g, b, a));
505  }
506  inline const Eigen::Vector4i getRGBVector4i () const { return (Eigen::Vector4i (r, g, b, a)); }
507 
508  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBA& p);
509  };
510 
511 
513  {
514  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
516  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
517  };
518 
520  {
521  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
523  uint32_t label;
524  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
525  };
526 
527  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
528  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color.
529  *
530  * Due to historical reasons (PCL was first developed as a ROS package), the
531  * RGB information is packed into an integer and casted to a float. This is
532  * something we wish to remove in the near future, but in the meantime, the
533  * following code snippet should help you pack and unpack RGB colors in your
534  * PointXYZRGB structure:
535  *
536  * \code
537  * // pack r/g/b into rgb
538  * uint8_t r = 255, g = 0, b = 0; // Example: Red color
539  * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
540  * p.rgb = *reinterpret_cast<float*>(&rgb);
541  * \endcode
542  *
543  * To unpack the data into separate values, use:
544  *
545  * \code
546  * PointXYZRGB p;
547  * // unpack rgb into r/g/b
548  * uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
549  * uint8_t r = (rgb >> 16) & 0x0000ff;
550  * uint8_t g = (rgb >> 8) & 0x0000ff;
551  * uint8_t b = (rgb) & 0x0000ff;
552  * \endcode
553  *
554  *
555  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
556  *
557  * \ingroup common
558  */
560  {
561  inline PointXYZRGB (const _PointXYZRGB &p)
562  {
563  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
564  rgb = p.rgb;
565  }
566 
567  inline PointXYZRGB ()
568  {
569  x = y = z = 0.0f;
570  data[3] = 1.0f;
571  r = g = b = a = 0;
572  }
573  inline PointXYZRGB (uint8_t _r, uint8_t _g, uint8_t _b)
574  {
575  x = y = z = 0.0f;
576  data[3] = 1.0f;
577  r = _r;
578  g = _g;
579  b = _b;
580  a = 0;
581  }
582 
583  inline Eigen::Vector3i getRGBVector3i ()
584  {
585  return (Eigen::Vector3i (r, g, b));
586  }
587  inline const Eigen::Vector3i getRGBVector3i () const { return (Eigen::Vector3i (r, g, b)); }
588  inline Eigen::Vector4i getRGBVector4i ()
589  {
590  return (Eigen::Vector4i (r, g, b, a));
591  }
592  inline const Eigen::Vector4i getRGBVector4i () const { return (Eigen::Vector4i (r, g, b, a)); }
593 
594 
595  friend std::ostream& operator << (std::ostream& os, const PointXYZRGB& p);
596  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
597  };
598 
599 
600  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
602  {
603  inline PointXYZRGBL (const _PointXYZRGBL &p)
604  {
605  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
606  rgba = p.rgba;
607  label = p.label;
608  }
609 
610  inline PointXYZRGBL ()
611  {
612  x = y = z = 0.0f;
613  data[3] = 1.0f;
614  r = g = b = 0;
615  a = 0;
616  label = 255;
617  }
618  inline PointXYZRGBL (uint8_t _r, uint8_t _g, uint8_t _b, uint32_t _label)
619  {
620  x = y = z = 0.0f;
621  data[3] = 1.0f;
622  r = _r;
623  g = _g;
624  b = _b;
625  a = 0;
626  label = _label;
627  }
628 
629  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBL& p);
630  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
631  };
632 
633 
635  {
636  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
637  union
638  {
639  struct
640  {
641  float h;
642  float s;
643  float v;
644  };
645  float data_c[4];
646  };
647  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
648  } EIGEN_ALIGN16;
649 
650  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
652  {
653  inline PointXYZHSV (const _PointXYZHSV &p)
654  {
655  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
656  h = p.h; s = p.s; v = p.v;
657  }
658 
659  inline PointXYZHSV ()
660  {
661  x = y = z = 0.0f;
662  data[3] = 1.0f;
663  h = s = v = data_c[3] = 0;
664  }
665  inline PointXYZHSV (float _h, float _v, float _s)
666  {
667  x = y = z = 0.0f;
668  data[3] = 1.0f;
669  h = _h; v = _v; s = _s;
670  data_c[3] = 0;
671  }
672 
673  friend std::ostream& operator << (std::ostream& os, const PointXYZHSV& p);
674  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
675  };
676 
677 
678 
679  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXY& p);
680  /** \brief A 2D point structure representing Euclidean xy coordinates.
681  * \ingroup common
682  */
683  struct PointXY
684  {
685  float x;
686  float y;
687 
688  friend std::ostream& operator << (std::ostream& os, const PointXY& p);
689  };
690 
691  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointUV& p);
692  /** \brief A 2D point structure representing pixel image coordinates.
693  * \note We use float to be able to represent subpixels.
694  * \ingroup common
695  */
696  struct PointUV
697  {
698  float u;
699  float v;
700 
701  friend std::ostream& operator << (std::ostream& os, const PointUV& p);
702  };
703 
704  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const InterestPoint& p);
705  /** \brief A point structure representing an interest point with Euclidean xyz coordinates, and an interest value.
706  * \ingroup common
707  */
709  {
710  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
711  union
712  {
713  struct
714  {
715  float strength;
716  };
717  float data_c[4];
718  };
719  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
720 
721  friend std::ostream& operator << (std::ostream& os, const InterestPoint& p);
722  };
723 
725  {
726  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
727  union
728  {
729  struct
730  {
731  float curvature;
732  };
733  float data_c[4];
734  };
735  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
736  };
737 
738  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Normal& p);
739  /** \brief A point structure representing normal coordinates and the surface curvature estimate. (SSE friendly)
740  * \ingroup common
741  */
742  struct Normal : public _Normal
743  {
744  inline Normal (const _Normal &p)
745  {
746  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
747  data_n[3] = 0.0f;
748  curvature = p.curvature;
749  }
750 
751  inline Normal ()
752  {
753  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
754  curvature = 0;
755  }
756 
757  inline Normal (float n_x, float n_y, float n_z)
758  {
759  normal_x = n_x; normal_y = n_y; normal_z = n_z;
760  curvature = 0;
761  data_n[3] = 0.0f;
762  }
763 
764  friend std::ostream& operator << (std::ostream& os, const Normal& p);
765  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
766  };
767 
768 
770  {
772  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
773  };
774 
775  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Axis& p);
776  /** \brief A point structure representing an Axis using its normal coordinates. (SSE friendly)
777  * \ingroup common
778  */
779  struct EIGEN_ALIGN16 Axis : public _Axis
780  {
781  inline Axis (const _Axis &p)
782  {
783  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z;
784  data_n[3] = 0.0f;
785  }
786 
787  inline Axis ()
788  {
789  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
790  }
791 
792  inline Axis (float n_x, float n_y, float n_z)
793  {
794  normal_x = n_x; normal_y = n_y; normal_z = n_z;
795  data_n[3] = 0.0f;
796  }
797 
798  friend std::ostream& operator << (std::ostream& os, const Axis& p);
799  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
800  };
801 
802 
804  {
805  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
806  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
807  union
808  {
809  struct
810  {
811  float curvature;
812  };
813  float data_c[4];
814  };
815  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
816  };
817 
818  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointNormal& p);
819  /** \brief A point structure representing Euclidean xyz coordinates, together with normal coordinates and the surface curvature estimate. (SSE friendly)
820  * \ingroup common
821  */
822  struct PointNormal : public _PointNormal
823  {
824  inline PointNormal (const _PointNormal &p)
825  {
826  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
827  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
828  curvature = p.curvature;
829  }
830 
831  inline PointNormal ()
832  {
833  x = y = z = 0.0f;
834  data[3] = 1.0f;
835  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
836  }
837 
838  friend std::ostream& operator << (std::ostream& os, const PointNormal& p);
839  };
840 
841 
843  {
844  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
845  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
846  union
847  {
848  struct
849  {
850  // RGB union
851  union
852  {
853  struct
854  {
855  uint8_t b;
856  uint8_t g;
857  uint8_t r;
858  uint8_t a;
859  };
860  float rgb;
861  uint32_t rgba;
862  };
863  float curvature;
864  };
865  float data_c[4];
866  };
867  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
868  };
869 
870  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
871  /** \brief A point structure representing Euclidean xyz coordinates, and the RGB color, together with normal coordinates and the surface curvature estimate.
872  * Due to historical reasons (PCL was first developed as a ROS package), the
873  * RGB information is packed into an integer and casted to a float. This is
874  * something we wish to remove in the near future, but in the meantime, the
875  * following code snippet should help you pack and unpack RGB colors in your
876  * PointXYZRGB structure:
877  *
878  * \code
879  * // pack r/g/b into rgb
880  * uint8_t r = 255, g = 0, b = 0; // Example: Red color
881  * uint32_t rgb = ((uint32_t)r << 16 | (uint32_t)g << 8 | (uint32_t)b);
882  * p.rgb = *reinterpret_cast<float*>(&rgb);
883  * \endcode
884  *
885  * To unpack the data into separate values, use:
886  *
887  * \code
888  * PointXYZRGB p;
889  * // unpack rgb into r/g/b
890  * uint32_t rgb = *reinterpret_cast<int*>(&p.rgb);
891  * uint8_t r = (rgb >> 16) & 0x0000ff;
892  * uint8_t g = (rgb >> 8) & 0x0000ff;
893  * uint8_t b = (rgb) & 0x0000ff;
894  * \endcode
895  *
896  *
897  * Alternatively, from 1.1.0 onwards, you can use p.r, p.g, and p.b directly.
898  * \ingroup common
899  */
901  {
903  {
904  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
905  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
906  curvature = p.curvature;
907  rgba = p.rgba;
908  }
909 
911  {
912  x = y = z = 0.0f;
913  data[3] = 1.0f;
914  r = g = b = a = 0;
915  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
916  curvature = 0;
917  }
918 
919  inline Eigen::Vector3i getRGBVector3i ()
920  {
921  return (Eigen::Vector3i (r, g, b));
922  }
923  inline const Eigen::Vector3i getRGBVector3i () const { return (Eigen::Vector3i (r, g, b)); }
924  inline Eigen::Vector4i getRGBVector4i ()
925  {
926  return (Eigen::Vector4i (r, g, b, a));
927  }
928  inline const Eigen::Vector4i getRGBVector4i () const { return (Eigen::Vector4i (r, g, b, a)); }
929 
930  friend std::ostream& operator << (std::ostream& os, const PointXYZRGBNormal& p);
931  };
932 
934  {
935  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
936  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
937  union
938  {
939  struct
940  {
941  float intensity;
942  float curvature;
943  };
944  float data_c[4];
945  };
946  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
947  };
948 
949  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
950  /** \brief A point structure representing Euclidean xyz coordinates, intensity, together with normal coordinates and the surface curvature estimate.
951  * \ingroup common
952  */
954  {
956  {
957  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
958  normal_x = p.normal_x; normal_y = p.normal_y; normal_z = p.normal_z; data_n[3] = 0.0f;
959  curvature = p.curvature;
960  intensity = p.intensity;
961  }
962 
963  inline PointXYZINormal ()
964  {
965  x = y = z = 0.0f;
966  data[3] = 1.0f;
967  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
968  intensity = 0.0f;
969  }
970 
971  friend std::ostream& operator << (std::ostream& os, const PointXYZINormal& p);
972  };
973 
974 
976  {
977  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
978  union
979  {
980  struct
981  {
982  float range;
983  };
984  float data_c[4];
985  };
986  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
987  };
988 
989  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithRange& p);
990  /** \brief A point structure representing Euclidean xyz coordinates, padded with an extra range float.
991  * \ingroup common
992  */
994  {
995  inline PointWithRange (const _PointWithRange &p)
996  {
997  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
998  range = p.range;
999  }
1000 
1001  inline PointWithRange ()
1002  {
1003  x = y = z = 0.0f;
1004  data[3] = 1.0f;
1005  range = 0.0f;
1006  }
1007 
1008  friend std::ostream& operator << (std::ostream& os, const PointWithRange& p);
1009  };
1010 
1011 
1013  {
1014  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1015  union
1016  {
1017  struct
1018  {
1019  float vp_x;
1020  float vp_y;
1021  float vp_z;
1022  };
1023  float data_c[4];
1024  };
1025  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1026  };
1027 
1028  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1029  /** \brief A point structure representing Euclidean xyz coordinates together with the viewpoint from which it was seen.
1030  * \ingroup common
1031  */
1033  {
1035  {
1036  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1037  vp_x = p.vp_x; vp_y = p.vp_y; vp_z = p.vp_z;
1038  }
1039 
1040  inline PointWithViewpoint (float _x = 0.0f, float _y = 0.0f, float _z = 0.0f,
1041  float _vp_x = 0.0f, float _vp_y = 0.0f, float _vp_z = 0.0f)
1042  {
1043  x = _x; y = _y; z = _z;
1044  data[3] = 1.0f;
1045  vp_x = _vp_x; vp_y = _vp_y; vp_z = _vp_z;
1046  }
1047 
1048  friend std::ostream& operator << (std::ostream& os, const PointWithViewpoint& p);
1049  };
1050 
1051  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1052  /** \brief A point structure representing the three moment invariants.
1053  * \ingroup common
1054  */
1056  {
1057  float j1, j2, j3;
1058 
1059  friend std::ostream& operator << (std::ostream& os, const MomentInvariants& p);
1060  };
1061 
1062  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1063  /** \brief A point structure representing the minimum and maximum surface radii (in meters) computed using RSD.
1064  * \ingroup common
1065  */
1067  {
1068  float r_min, r_max;
1069 
1070  friend std::ostream& operator << (std::ostream& os, const PrincipalRadiiRSD& p);
1071  };
1072 
1073  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Boundary& p);
1074  /** \brief A point structure representing a description of whether a point is lying on a surface boundary or not.
1075  * \ingroup common
1076  */
1077  struct Boundary
1078  {
1080 
1081  friend std::ostream& operator << (std::ostream& os, const Boundary& p);
1082  };
1083 
1084  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1085  /** \brief A point structure representing the principal curvatures and their magnitudes.
1086  * \ingroup common
1087  */
1089  {
1090  union
1091  {
1093  struct
1094  {
1098  };
1099  };
1100  float pc1;
1101  float pc2;
1102 
1103  friend std::ostream& operator << (std::ostream& os, const PrincipalCurvatures& p);
1104  };
1105 
1106  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1107  /** \brief A point structure representing the Point Feature Histogram (PFH).
1108  * \ingroup common
1109  */
1111  {
1112  float histogram[125];
1113 
1114  friend std::ostream& operator << (std::ostream& os, const PFHSignature125& p);
1115  };
1116 
1117  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1118  /** \brief A point structure representing the Point Feature Histogram with colors (PFHRGB).
1119  * \ingroup common
1120  */
1122  {
1123  float histogram[250];
1124 
1125  friend std::ostream& operator << (std::ostream& os, const PFHRGBSignature250& p);
1126  };
1127 
1128  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1129  /** \brief A point structure for storing the Point Pair Feature (PPF) values
1130  * \ingroup common
1131  */
1133  {
1134  float f1, f2, f3, f4;
1135  float alpha_m;
1136 
1137  friend std::ostream& operator << (std::ostream& os, const PPFSignature& p);
1138  };
1139 
1140  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1141  /** \brief A point structure for storing the Point Pair Color Feature (PPFRGB) values
1142  * \ingroup common
1143  */
1145  {
1146  float f1, f2, f3, f4;
1148  float alpha_m;
1149 
1150  friend std::ostream& operator << (std::ostream& os, const PPFRGBSignature& p);
1151  };
1152 
1153  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1154  /** \brief A point structure representing the Normal Based Signature for
1155  * a feature matrix of 4-by-3
1156  * \ingroup common
1157  */
1159  {
1160  float values[12];
1161 
1162  friend std::ostream& operator << (std::ostream& os, const NormalBasedSignature12& p);
1163  };
1164 
1165  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1166  /** \brief A point structure representing a Shape Context.
1167  * \ingroup common
1168  */
1170  {
1171  float descriptor[1980];
1172  float rf[9];
1173 
1174  friend std::ostream& operator << (std::ostream& os, const ShapeContext1980& p);
1175  };
1176 
1177 
1178  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT352& p);
1179  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape only.
1180  * \ingroup common
1181  */
1182  struct SHOT352
1183  {
1184  float descriptor[352];
1185  float rf[9];
1186 
1187  friend std::ostream& operator << (std::ostream& os, const SHOT352& p);
1188  };
1189 
1190 
1191  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1192  /** \brief A point structure representing the generic Signature of Histograms of OrienTations (SHOT) - shape+color.
1193  * \ingroup common
1194  */
1195  struct SHOT1344
1196  {
1197  float descriptor[1344];
1198  float rf[9];
1199 
1200  friend std::ostream& operator << (std::ostream& os, const SHOT1344& p);
1201  };
1202 
1203 
1204  /** \brief A structure representing the Local Reference Frame of a point.
1205  * \ingroup common
1206  */
1208  {
1209  union
1210  {
1211  float rf[9];
1212  struct
1213  {
1214  float x_axis[3];
1215  float y_axis[3];
1216  float z_axis[3];
1217  };
1218  };
1219 
1220  inline Eigen::Map<Eigen::Vector3f> getXAxisVector3fMap () { return (Eigen::Vector3f::Map (x_axis)); }
1221  inline const Eigen::Map<const Eigen::Vector3f> getXAxisVector3fMap () const { return (Eigen::Vector3f::Map (x_axis)); }
1222  inline Eigen::Map<Eigen::Vector3f> getYAxisVector3fMap () { return (Eigen::Vector3f::Map (y_axis)); }
1223  inline const Eigen::Map<const Eigen::Vector3f> getYAxisVector3fMap () const { return (Eigen::Vector3f::Map (y_axis)); }
1224  inline Eigen::Map<Eigen::Vector3f> getZAxisVector3fMap () { return (Eigen::Vector3f::Map (z_axis)); }
1225  inline const Eigen::Map<const Eigen::Vector3f> getZAxisVector3fMap () const { return (Eigen::Vector3f::Map (z_axis)); }
1226  inline Eigen::Map<Eigen::Matrix3f> getMatrix3fMap () { return (Eigen::Matrix3f::Map (rf)); }
1227  inline const Eigen::Map<const Eigen::Matrix3f> getMatrix3fMap () const { return (Eigen::Matrix3f::Map (rf)); }
1228 
1229  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1230  };
1231 
1232  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1234  {
1236  {
1237  for (int d = 0; d < 9; ++d)
1238  rf[d] = p.rf[d];
1239  }
1240 
1241  inline ReferenceFrame ()
1242  {
1243  for (int d = 0; d < 3; ++d)
1244  x_axis[d] = y_axis[d] = z_axis[d] = 0;
1245  }
1246 
1247  friend std::ostream& operator << (std::ostream& os, const ReferenceFrame& p);
1248  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1249  };
1250 
1251 
1252  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1253  /** \brief A point structure representing the Fast Point Feature Histogram (FPFH).
1254  * \ingroup common
1255  */
1257  {
1258  float histogram[33];
1259 
1260  friend std::ostream& operator << (std::ostream& os, const FPFHSignature33& p);
1261  };
1262 
1263  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1264  /** \brief A point structure representing the Viewpoint Feature Histogram (VFH).
1265  * \ingroup common
1266  */
1268  {
1269  float histogram[308];
1270 
1271  friend std::ostream& operator << (std::ostream& os, const VFHSignature308& p);
1272  };
1273 
1274  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1275  /** \brief A point structure representing the Ensemble of Shape Functions (ESF).
1276  * \ingroup common
1277  */
1279  {
1280  float histogram[640];
1281 
1282  friend std::ostream& operator << (std::ostream& os, const ESFSignature640& p);
1283  };
1284 
1285  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1286  /** \brief A point structure representing the GFPFH descriptor with 16 bins.
1287  * \ingroup common
1288  */
1290  {
1291  float histogram[16];
1292  static int descriptorSize() { return 16; }
1293 
1294  friend std::ostream& operator << (std::ostream& os, const GFPFHSignature16& p);
1295  };
1296 
1297  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const Narf36& p);
1298  /** \brief A point structure representing the Narf descriptor.
1299  * \ingroup common
1300  */
1301  struct Narf36
1302  {
1303  float x, y, z, roll, pitch, yaw;
1304  float descriptor[36];
1305 
1306  friend std::ostream& operator << (std::ostream& os, const Narf36& p);
1307  };
1308 
1309  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1310  /** \brief A structure to store if a point in a range image lies on a border between an obstacle and the background.
1311  * \ingroup common
1312  */
1314  {
1315  int x, y;
1317  //std::vector<const BorderDescription*> neighbors;
1318 
1319  friend std::ostream& operator << (std::ostream& os, const BorderDescription& p);
1320  };
1321 
1322 
1323  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1324  /** \brief A point structure representing the intensity gradient of an XYZI point cloud.
1325  * \ingroup common
1326  */
1328  {
1329  union
1330  {
1331  float gradient[3];
1332  struct
1333  {
1334  float gradient_x;
1335  float gradient_y;
1336  float gradient_z;
1337  };
1338  };
1339 
1340  friend std::ostream& operator << (std::ostream& os, const IntensityGradient& p);
1341  };
1342 
1343  /** \brief A point structure representing an N-D histogram.
1344  * \ingroup common
1345  */
1346  template <int N>
1347  struct Histogram
1348  {
1349  float histogram[N];
1350  };
1351 
1353  {
1354  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1355 
1356  union
1357  {
1358  /** \brief Diameter of the meaningfull keypoint neighborhood. */
1359  float scale;
1360  float size;
1361  };
1362 
1363  /** \brief Computed orientation of the keypoint (-1 if not applicable). */
1364  float angle;
1365  /** \brief The response by which the most strong keypoints have been selected. */
1366  float response;
1367  /** \brief octave (pyramid layer) from which the keypoint has been extracted. */
1368  int octave;
1369 
1370  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1371  };
1372 
1373  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1374  /** \brief A point structure representing a 3-D position and scale.
1375  * \ingroup common
1376  */
1378  {
1380  {
1381  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1382  scale = p.scale;
1383  angle = p.angle;
1384  response = p.response;
1385  octave = p.octave;
1386  }
1387 
1388  inline PointWithScale ()
1389  {
1390  x = y = z = 0.0f;
1391  scale = 1.0f;
1392  angle = -1.0f;
1393  response = 0.0f;
1394  octave = 0;
1395  data[3] = 1.0f;
1396  }
1397 
1398  inline PointWithScale (float _x, float _y, float _z, float _scale)
1399  {
1400  x = _x;
1401  y = _y;
1402  z = _z;
1403  scale = _scale;
1404  angle = -1.0f;
1405  response = 0.0f;
1406  octave = 0;
1407  data[3] = 1.0f;
1408  }
1409 
1410  inline PointWithScale (float _x, float _y, float _z, float _scale, float _angle, float _response, int _octave)
1411  {
1412  x = _x;
1413  y = _y;
1414  z = _z;
1415  scale = _scale;
1416  angle = _angle;
1417  response = _response;
1418  octave = _octave;
1419  data[3] = 1.0f;
1420  }
1421 
1422  friend std::ostream& operator << (std::ostream& os, const PointWithScale& p);
1423  };
1424 
1425 
1427  {
1428  PCL_ADD_POINT4D; // This adds the members x,y,z which can also be accessed using the point (which is float[4])
1429  PCL_ADD_NORMAL4D; // This adds the member normal[3] which can also be accessed using the point (which is float[4])
1430  union
1431  {
1432  struct
1433  {
1434  // RGB union
1435  union
1436  {
1437  struct
1438  {
1439  uint8_t b;
1440  uint8_t g;
1441  uint8_t r;
1442  uint8_t a;
1443  };
1444  float rgb;
1445  uint32_t rgba;
1446  };
1447  float radius;
1448  float confidence;
1449  float curvature;
1450  };
1451  float data_c[4];
1452  };
1453  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1454  };
1455 
1456  PCL_EXPORTS std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1457  /** \brief A surfel, that is, a point structure representing Euclidean xyz coordinates, together with normal coordinates, a RGBA color, a radius, a confidence value and the surface curvature estimate.
1458  * \ingroup common
1459  */
1460  struct PointSurfel : public _PointSurfel
1461  {
1462  inline PointSurfel (const _PointSurfel &p)
1463  {
1464  x = p.x; y = p.y; z = p.z; data[3] = 1.0f;
1465  rgba = p.rgba;
1466  radius = p.radius;
1467  confidence = p.confidence;
1468  curvature = p.curvature;
1469  }
1470 
1471  inline PointSurfel ()
1472  {
1473  x = y = z = 0.0f;
1474  data[3] = 1.0f;
1475  normal_x = normal_y = normal_z = data_n[3] = 0.0f;
1476  rgba = 0;
1477  radius = confidence = curvature = 0.0f;
1478  }
1479 
1480  friend std::ostream& operator << (std::ostream& os, const PointSurfel& p);
1481  };
1482 
1483  template <int N> std::ostream&
1484  operator << (std::ostream& os, const Histogram<N>& p)
1485  {
1486  for (int i = 0; i < N; ++i)
1487  os << (i == 0 ? "(" : "") << p.histogram[i] << (i < N-1 ? ", " : ")");
1488  return (os);
1489  }
1490 } // End namespace
1491 
1492 // Preserve API for PCL users < 1.4
1493 #include <pcl/common/point_tests.h>
1494 
1495 #endif