Point Cloud Library (PCL)  1.9.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
point_types.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2011, Willow Garage, 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  * $Id$
37  *
38  */
39 #ifndef PCL_DATA_TYPES_H_
40 #define PCL_DATA_TYPES_H_
41 
42 #include <pcl/pcl_macros.h>
43 #include <bitset>
44 #include <pcl/register_point_struct.h>
45 #include <boost/mpl/contains.hpp>
46 #include <boost/mpl/fold.hpp>
47 #include <boost/mpl/vector.hpp>
48 
49 /**
50  * \file pcl/point_types.h
51  * Defines all the PCL implemented PointT point type structures
52  * \ingroup common
53  */
54 
55 // We're doing a lot of black magic with Boost here, so disable warnings in Maintainer mode, as we will never
56 // be able to fix them anyway
57 #if defined _MSC_VER
58  #pragma warning(disable: 4201)
59 #endif
60 //#pragma warning(push, 1)
61 #if defined __GNUC__
62 # pragma GCC system_header
63 #endif
64 
65 /** @{*/
66 namespace pcl
67 {
68  /** \brief Members: float x, y, z
69  * \ingroup common
70  */
71  struct PointXYZ;
72 
73  /** \brief Members: rgba
74  * \ingroup common
75  */
76  struct RGB;
77 
78  /** \brief Members: intensity (float)
79  * \ingroup common
80  */
81  struct Intensity;
82 
83  /** \brief Members: intensity (uint8_t)
84  * \ingroup common
85  */
86  struct Intensity8u;
87 
88  /** \brief Members: intensity (uint32_t)
89  * \ingroup common
90  */
91  struct Intensity32u;
92 
93  /** \brief Members: float x, y, z, intensity
94  * \ingroup common
95  */
96  struct PointXYZI;
97 
98  /** \brief Members: float x, y, z, uin32_t label
99  * \ingroup common
100  */
101  struct PointXYZL;
102 
103  /** \brief Members: uint32_t label
104  * \ingroup common
105  */
106  struct Label;
107 
108  /** \brief Members: float x, y, z; uint32_t rgba
109  * \ingroup common
110  */
111  struct PointXYZRGBA;
112 
113  /** \brief Members: float x, y, z, rgb
114  * \ingroup common
115  */
116  struct PointXYZRGB;
117 
118  /** \brief Members: float x, y, z, rgb, uint32_t label
119  * \ingroup common
120  */
121  struct PointXYZRGBL;
122 
123  /** \brief Members: float x, y, z, h, s, v
124  * \ingroup common
125  */
126  struct PointXYZHSV;
127 
128  /** \brief Members: float x, y
129  * \ingroup common
130  */
131  struct PointXY;
132 
133  /** \brief Members: float u, v
134  * \ingroup common
135  */
136  struct PointUV;
137 
138  /** \brief Members: float x, y, z, strength
139  * \ingroup common
140  */
141  struct InterestPoint;
142 
143  /** \brief Members: float normal[3], curvature
144  * \ingroup common
145  */
146  struct Normal;
147 
148  /** \brief Members: float normal[3]
149  * \ingroup common
150  */
151  struct Axis;
152 
153  /** \brief Members: float x, y, z; float normal[3], curvature
154  * \ingroup common
155  */
156  struct PointNormal;
157 
158  /** \brief Members: float x, y, z, rgb, normal[3], curvature
159  * \ingroup common
160  */
161  struct PointXYZRGBNormal;
162 
163  /** \brief Members: float x, y, z, intensity, normal[3], curvature
164  * \ingroup common
165  */
166  struct PointXYZINormal;
167 
168  /** \brief Members: float x, y, z, label, normal[3], curvature
169  * \ingroup common
170  */
171  struct PointXYZLNormal;
172 
173  /** \brief Members: float x, y, z (union with float point[4]), range
174  * \ingroup common
175  */
176  struct PointWithRange;
177 
178  /** \brief Members: float x, y, z, vp_x, vp_y, vp_z
179  * \ingroup common
180  */
181  struct PointWithViewpoint;
182 
183  /** \brief Members: float j1, j2, j3
184  * \ingroup common
185  */
186  struct MomentInvariants;
187 
188  /** \brief Members: float r_min, r_max
189  * \ingroup common
190  */
191  struct PrincipalRadiiRSD;
192 
193  /** \brief Members: uint8_t boundary_point
194  * \ingroup common
195  */
196  struct Boundary;
197 
198  /** \brief Members: float principal_curvature[3], pc1, pc2
199  * \ingroup common
200  */
201  struct PrincipalCurvatures;
202 
203  /** \brief Members: float descriptor[352], rf[9]
204  * \ingroup common
205  */
206  struct SHOT352;
207 
208  /** \brief Members: float descriptor[1344], rf[9]
209  * \ingroup common
210  */
211  struct SHOT1344;
212 
213  /** \brief Members: Axis x_axis, y_axis, z_axis
214  * \ingroup common
215  */
216  struct ReferenceFrame;
217 
218  /** \brief Members: float descriptor[1980], rf[9]
219  * \ingroup common
220  */
221  struct ShapeContext1980;
222 
223  /** \brief Members: float descriptor[1960], rf[9]
224  * \ingroup common
225  */
226  struct UniqueShapeContext1960;
227 
228  /** \brief Members: float pfh[125]
229  * \ingroup common
230  */
231  struct PFHSignature125;
232 
233  /** \brief Members: float pfhrgb[250]
234  * \ingroup common
235  */
236  struct PFHRGBSignature250;
237 
238  /** \brief Members: float f1, f2, f3, f4, alpha_m
239  * \ingroup common
240  */
241  struct PPFSignature;
242 
243  /** \brief Members: float f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, alpha_m
244  * \ingroup common
245  */
246  struct CPPFSignature;
247 
248  /** \brief Members: float f1, f2, f3, f4, r_ratio, g_ratio, b_ratio, alpha_m
249  * \ingroup common
250  */
251  struct PPFRGBSignature;
252 
253  /** \brief Members: float values[12]
254  * \ingroup common
255  */
256  struct NormalBasedSignature12;
257 
258  /** \brief Members: float fpfh[33]
259  * \ingroup common
260  */
261  struct FPFHSignature33;
262 
263  /** \brief Members: float vfh[308]
264  * \ingroup common
265  */
266  struct VFHSignature308;
267 
268  /** \brief Members: float grsd[21]
269  * \ingroup common
270  */
271  struct GRSDSignature21;
272 
273  /** \brief Members: float esf[640]
274  * \ingroup common
275  */
276  struct ESFSignature640;
277 
278  /** \brief Members: float gasd[512]
279  * \ingroup common
280  */
281  struct GASDSignature512;
282 
283  /** \brief Members: float gasd[984]
284  * \ingroup common
285  */
286  struct GASDSignature984;
287 
288  /** \brief Members: float gasd[7992]
289  * \ingroup common
290  */
291  struct GASDSignature7992;
292 
293  /** \brief Members: float histogram[16]
294  * \ingroup common
295  */
296  struct GFPFHSignature16;
297 
298  /** \brief Members: float scale; float orientation; uint8_t descriptor[64]
299  * \ingroup common
300  */
301  struct BRISKSignature512;
302 
303  /** \brief Members: float x, y, z, roll, pitch, yaw; float descriptor[36]
304  * \ingroup common
305  */
306  struct Narf36;
307 
308  /** \brief Data type to store extended information about a transition from foreground to backgroundSpecification of the fields for BorderDescription::traits.
309  * \ingroup common
310  */
311  typedef std::bitset<32> BorderTraits;
312 
313  /** \brief Specification of the fields for BorderDescription::traits.
314  * \ingroup common
315  */
317  {
323  };
324 
325  /** \brief Members: int x, y; BorderTraits traits
326  * \ingroup common
327  */
328  struct BorderDescription;
329 
330  /** \brief Members: float gradient[3]
331  * \ingroup common
332  */
333  struct IntensityGradient;
334 
335  /** \brief Members: float histogram[N]
336  * \ingroup common
337  */
338  template<int N>
339  struct Histogram;
340 
341  /** \brief Members: float x, y, z, scale, angle, response, octave
342  * \ingroup common
343  */
344  struct PointWithScale;
345 
346  /** \brief Members: float x, y, z, normal[3], rgba, radius, confidence, curvature
347  * \ingroup common
348  */
349  struct PointSurfel;
350 
351  /** \brief Members: float x, y, z, intensity, intensity_variance, height_variance
352  * \ingroup common
353  */
354  struct PointDEM;
355 }
356 
357 /** @} */
358 
359 #include <pcl/impl/point_types.hpp> // Include struct definitions
360 
361 // ==============================
362 // =====POINT_CLOUD_REGISTER=====
363 // ==============================
364 
366  (uint32_t, rgba, rgba)
367 )
368 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::RGB, pcl::_RGB)
369 
371  (float, intensity, intensity)
372 )
373 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity, pcl::_Intensity)
374 
376  (uint8_t, intensity, intensity)
377 )
378 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity8u, pcl::_Intensity8u)
379 
380 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_Intensity32u,
381  (uint32_t, intensity, intensity)
382 )
383 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Intensity32u, pcl::_Intensity32u)
384 
386  (float, x, x)
387  (float, y, y)
388  (float, z, z)
389 )
390 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZ, pcl::_PointXYZ)
391 
392 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBA,
393  (float, x, x)
394  (float, y, y)
395  (float, z, z)
396  (uint32_t, rgba, rgba)
397 )
398 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBA, pcl::_PointXYZRGBA)
399 
401  (float, x, x)
402  (float, y, y)
403  (float, z, z)
404  (float, rgb, rgb)
405 )
406 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGB, pcl::_PointXYZRGB)
407 
408 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBL,
409  (float, x, x)
410  (float, y, y)
411  (float, z, z)
412  (uint32_t, rgba, rgba)
413  (uint32_t, label, label)
414 )
415 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBL, pcl::_PointXYZRGBL)
416 
418  (float, x, x)
419  (float, y, y)
420  (float, z, z)
421  (float, h, h)
422  (float, s, s)
423  (float, v, v)
424 )
425 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZHSV, pcl::_PointXYZHSV)
426 
428  (float, x, x)
429  (float, y, y)
430 )
431 
433  (float, u, u)
434  (float, v, v)
435 )
436 
437 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::InterestPoint,
438  (float, x, x)
439  (float, y, y)
440  (float, z, z)
441  (float, strength, strength)
442 )
443 
445  (float, x, x)
446  (float, y, y)
447  (float, z, z)
448  (float, intensity, intensity)
449 )
450 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZI, pcl::_PointXYZI)
451 
453  (float, x, x)
454  (float, y, y)
455  (float, z, z)
456  (uint32_t, label, label)
457 )
458 
460  (uint32_t, label, label)
461 )
462 
464  (float, normal_x, normal_x)
465  (float, normal_y, normal_y)
466  (float, normal_z, normal_z)
467  (float, curvature, curvature)
468 )
469 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Normal, pcl::_Normal)
470 
472  (float, normal_x, normal_x)
473  (float, normal_y, normal_y)
474  (float, normal_z, normal_z)
475 )
476 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::Axis, pcl::_Axis)
477 
479  (float, x, x)
480  (float, y, y)
481  (float, z, z)
482  (float, normal_x, normal_x)
483  (float, normal_y, normal_y)
484  (float, normal_z, normal_z)
485  (float, curvature, curvature)
486 )
487 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointXYZRGBNormal,
488  (float, x, x)
489  (float, y, y)
490  (float, z, z)
491  (float, rgb, rgb)
492  (float, normal_x, normal_x)
493  (float, normal_y, normal_y)
494  (float, normal_z, normal_z)
495  (float, curvature, curvature)
496 )
497 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointXYZRGBNormal, pcl::_PointXYZRGBNormal)
498 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZINormal,
499  (float, x, x)
500  (float, y, y)
501  (float, z, z)
502  (float, intensity, intensity)
503  (float, normal_x, normal_x)
504  (float, normal_y, normal_y)
505  (float, normal_z, normal_z)
506  (float, curvature, curvature)
507 )
508 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointXYZLNormal,
509  (float, x, x)
510  (float, y, y)
511  (float, z, z)
512  (uint32_t, label, label)
513  (float, normal_x, normal_x)
514  (float, normal_y, normal_y)
515  (float, normal_z, normal_z)
516  (float, curvature, curvature)
517 )
518 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointWithRange,
519  (float, x, x)
520  (float, y, y)
521  (float, z, z)
522  (float, range, range)
523 )
524 
525 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_PointWithViewpoint,
526  (float, x, x)
527  (float, y, y)
528  (float, z, z)
529  (float, vp_x, vp_x)
530  (float, vp_y, vp_y)
531  (float, vp_z, vp_z)
532 )
533 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointWithViewpoint, pcl::_PointWithViewpoint)
534 
535 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::MomentInvariants,
536  (float, j1, j1)
537  (float, j2, j2)
538  (float, j3, j3)
539 )
540 
541 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalRadiiRSD,
542  (float, r_min, r_min)
543  (float, r_max, r_max)
544 )
545 
547  (uint8_t, boundary_point, boundary_point)
548 )
549 
550 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PrincipalCurvatures,
551  (float, principal_curvature_x, principal_curvature_x)
552  (float, principal_curvature_y, principal_curvature_y)
553  (float, principal_curvature_z, principal_curvature_z)
554  (float, pc1, pc1)
555  (float, pc2, pc2)
556 )
557 
558 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PFHSignature125,
559  (float[125], histogram, pfh)
560 )
561 
562 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PFHRGBSignature250,
563  (float[250], histogram, pfhrgb)
564 )
565 
567  (float, f1, f1)
568  (float, f2, f2)
569  (float, f3, f3)
570  (float, f4, f4)
571  (float, alpha_m, alpha_m)
572 )
573 
574 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::CPPFSignature,
575  (float, f1, f1)
576  (float, f2, f2)
577  (float, f3, f3)
578  (float, f4, f4)
579  (float, f5, f5)
580  (float, f6, f6)
581  (float, f7, f7)
582  (float, f8, f8)
583  (float, f9, f9)
584  (float, f10, f10)
585  (float, alpha_m, alpha_m)
586 )
587 
588 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PPFRGBSignature,
589  (float, f1, f1)
590  (float, f2, f2)
591  (float, f3, f3)
592  (float, f4, f4)
593  (float, r_ratio, r_ratio)
594  (float, g_ratio, g_ratio)
595  (float, b_ratio, b_ratio)
596  (float, alpha_m, alpha_m)
597 )
598 
599 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::NormalBasedSignature12,
600  (float[12], values, values)
601 )
602 
603 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ShapeContext1980,
604  (float[1980], descriptor, shape_context)
605  (float[9], rf, rf)
606 )
607 
608 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::UniqueShapeContext1960,
609  (float[1960], descriptor, shape_context)
610  (float[9], rf, rf)
611 )
612 
614  (float[352], descriptor, shot)
615  (float[9], rf, rf)
616 )
617 
619  (float[1344], descriptor, shot)
620  (float[9], rf, rf)
621 )
622 
623 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::FPFHSignature33,
624  (float[33], histogram, fpfh)
625 )
626 
627 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::BRISKSignature512,
628  (float, scale, brisk_scale)
629  (float, orientation, brisk_orientation)
630  (unsigned char[64], descriptor, brisk_descriptor512)
631 )
632 
633 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::VFHSignature308,
634  (float[308], histogram, vfh)
635 )
636 
637 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::GRSDSignature21,
638  (float[21], histogram, grsd)
639 )
640 
641 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::ESFSignature640,
642  (float[640], histogram, esf)
643 )
644 
645 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature512,
646  (float[512], histogram, gasd)
647 )
648 
649 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature984,
650  (float[984], histogram, gasd)
651 )
652 
653 POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::GASDSignature7992,
654  (float[7992], histogram, gasd)
655 )
656 
658  (float[36], descriptor, descriptor)
659 )
660 
661 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::GFPFHSignature16,
662  (float[16], histogram, gfpfh)
663 )
664 
665 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::IntensityGradient,
666  (float, gradient_x, gradient_x)
667  (float, gradient_y, gradient_y)
668  (float, gradient_z, gradient_z)
669 )
670 
671 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::PointWithScale,
672  (float, x, x)
673  (float, y, y)
674  (float, z, z)
675  (float, scale, scale)
676 )
677 
679  (float, x, x)
680  (float, y, y)
681  (float, z, z)
682  (float, normal_x, normal_x)
683  (float, normal_y, normal_y)
684  (float, normal_z, normal_z)
685  (uint32_t, rgba, rgba)
686  (float, radius, radius)
687  (float, confidence, confidence)
688  (float, curvature, curvature)
689 )
690 
691 POINT_CLOUD_REGISTER_POINT_STRUCT (pcl::_ReferenceFrame,
692  (float[3], x_axis, x_axis)
693  (float[3], y_axis, y_axis)
694  (float[3], z_axis, z_axis)
695 )
696 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::ReferenceFrame, pcl::_ReferenceFrame)
697 
699  (float, x, x)
700  (float, y, y)
701  (float, z, z)
702  (float, intensity, intensity)
703  (float, intensity_variance, intensity_variance)
704  (float, height_variance, height_variance)
705 )
706 POINT_CLOUD_REGISTER_POINT_WRAPPER(pcl::PointDEM, pcl::_PointDEM)
707 
708 namespace pcl
709 {
710  // Allow float 'rgb' data to match to the newer uint32 'rgba' tag. This is so
711  // you can load old 'rgb' PCD files into e.g. a PointCloud<PointXYZRGBA>.
712  template<typename PointT>
713  struct FieldMatches<PointT, fields::rgba>
714  {
715  bool operator() (const pcl::PCLPointField& field)
716  {
717  if (field.name == "rgb")
718  {
719  // For fixing the alpha value bug #1141, the rgb field can also match
720  // uint32.
721  return ((field.datatype == pcl::PCLPointField::FLOAT32 ||
723  field.count == 1);
724  }
725  else
726  {
727  return (field.name == traits::name<PointT, fields::rgba>::value &&
728  field.datatype == traits::datatype<PointT, fields::rgba>::value &&
729  field.count == traits::datatype<PointT, fields::rgba>::size);
730  }
731  }
732  };
733  template<typename PointT>
734  struct FieldMatches<PointT, fields::rgb>
735  {
736  bool operator() (const pcl::PCLPointField& field)
737  {
738  if (field.name == "rgba")
739  {
740  return (field.datatype == pcl::PCLPointField::UINT32 &&
741  field.count == 1);
742  }
743  else
744  {
745  // For fixing the alpha value bug #1141, rgb can also match uint32
746  return (field.name == traits::name<PointT, fields::rgb>::value &&
747  (field.datatype == traits::datatype<PointT, fields::rgb>::value ||
749  field.count == traits::datatype<PointT, fields::rgb>::size);
750  }
751  }
752  };
753 
754  namespace traits
755  {
756 
757  /** \brief Metafunction to check if a given point type has a given field.
758  *
759  * Example usage at run-time:
760  *
761  * \code
762  * bool curvature_available = pcl::traits::has_field<PointT, pcl::fields::curvature>::value;
763  * \endcode
764  *
765  * Example usage at compile-time:
766  *
767  * \code
768  * BOOST_MPL_ASSERT_MSG ((pcl::traits::has_field<PointT, pcl::fields::label>::value),
769  * POINT_TYPE_SHOULD_HAVE_LABEL_FIELD,
770  * (PointT));
771  * \endcode
772  */
773  template <typename PointT, typename Field>
774  struct has_field : boost::mpl::contains<typename pcl::traits::fieldList<PointT>::type, Field>::type
775  { };
776 
777  /** Metafunction to check if a given point type has all given fields. */
778  template <typename PointT, typename Field>
779  struct has_all_fields : boost::mpl::fold<Field,
780  boost::mpl::bool_<true>,
781  boost::mpl::and_<boost::mpl::_1,
782  has_field<PointT, boost::mpl::_2> > >::type
783  { };
784 
785  /** Metafunction to check if a given point type has any of the given fields. */
786  template <typename PointT, typename Field>
787  struct has_any_field : boost::mpl::fold<Field,
788  boost::mpl::bool_<false>,
789  boost::mpl::or_<boost::mpl::_1,
790  has_field<PointT, boost::mpl::_2> > >::type
791  { };
792 
793  /** Metafunction to check if a given point type has x, y, and z fields. */
794  template <typename PointT>
795  struct has_xyz : has_all_fields<PointT, boost::mpl::vector<pcl::fields::x,
796  pcl::fields::y,
797  pcl::fields::z> >
798  { };
799 
800  /** Metafunction to check if a given point type has normal_x, normal_y, and
801  * normal_z fields. */
802  template <typename PointT>
803  struct has_normal : has_all_fields<PointT, boost::mpl::vector<pcl::fields::normal_x,
804  pcl::fields::normal_y,
805  pcl::fields::normal_z> >
806  { };
807 
808  /** Metafunction to check if a given point type has curvature field. */
809  template <typename PointT>
810  struct has_curvature : has_field<PointT, pcl::fields::curvature>
811  { };
812 
813  /** Metafunction to check if a given point type has intensity field. */
814  template <typename PointT>
815  struct has_intensity : has_field<PointT, pcl::fields::intensity>
816  { };
817 
818  /** Metafunction to check if a given point type has either rgb or rgba field. */
819  template <typename PointT>
820  struct has_color : has_any_field<PointT, boost::mpl::vector<pcl::fields::rgb,
821  pcl::fields::rgba> >
822  { };
823 
824  /** Metafunction to check if a given point type has label field. */
825  template <typename PointT>
826  struct has_label : has_field<PointT, pcl::fields::label>
827  { };
828 
829  }
830 
831 } // namespace pcl
832 
833 #if defined _MSC_VER
834  #pragma warning(default: 4201)
835 #endif
836 //#pragma warning(pop)
837 
838 #endif //#ifndef PCL_DATA_TYPES_H_
Histogram< 125 > PFHSignature125
Definition: internal.hpp:73
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
BorderTrait
Specification of the fields for BorderDescription::traits.
Definition: point_types.h:316
Metafunction to check if a given point type has normal_x, normal_y, and normal_z fields.
Definition: point_types.h:803
float4 PointXYZRGB
Definition: internal.hpp:60
Metafunction to check if a given point type has either rgb or rgba field.
Definition: point_types.h:820
pcl::uint32_t count
Definition: PCLPointField.h:25
Metafunction to check if a given point type has curvature field.
Definition: point_types.h:810
Metafunction to check if a given point type has intensity field.
Definition: point_types.h:815
Metafunction to check if a given point type has any of the given fields.
Definition: point_types.h:787
Metafunction to check if a given point type has x, y, and z fields.
Definition: point_types.h:795
POINT_CLOUD_REGISTER_POINT_STRUCT(pcl::_PointXYZLAB,(float, x, x)(float, y, y)(float, z, z)(float, L, L)(float, a, a)(float, b, b)) namespace pcl
Definition: gicp6d.h:78
Histogram< 308 > VFHSignature308
Definition: internal.hpp:76
Histogram< 33 > FPFHSignature33
Definition: internal.hpp:75
Metafunction to check if a given point type has all given fields.
Definition: point_types.h:779
Histogram< 250 > PFHRGBSignature250
Definition: internal.hpp:74
pcl::uint8_t datatype
Definition: PCLPointField.h:24
std::string name
Definition: PCLPointField.h:21
Metafunction to check if a given point type has label field.
Definition: point_types.h:826
A point structure representing the Narf descriptor.
A point structure representing Euclidean xyz coordinates, and the RGB color.
Metafunction to check if a given point type has a given field.
Definition: point_types.h:774
std::bitset< 32 > BorderTraits
Data type to store extended information about a transition from foreground to backgroundSpecification...
Definition: point_types.h:306