Point Cloud Library (PCL)  1.9.1
ply_parser.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2007-2012, Ares Lagae
6  * Copyright (c) 2010-2011, Willow Garage, 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  * $Id$
38  *
39  */
40 
41 #ifndef PCL_IO_PLY_PLY_PARSER_H
42 #define PCL_IO_PLY_PLY_PARSER_H
43 
44 #include <fstream>
45 #include <iostream>
46 #include <istream>
47 #include <sstream>
48 #include <string>
49 #include <vector>
50 
51 #ifdef BUILD_Maintainer
52 # if defined __GNUC__
53 # if __GNUC__ == 4 && __GNUC_MINOR__ > 3
54 # pragma GCC diagnostic ignored "-Weffc++"
55 # pragma GCC diagnostic ignored "-pedantic"
56 # else
57 # pragma GCC system_header
58 # endif
59 # elif defined _MSC_VER
60 # pragma warning(push, 1)
61 # endif
62 #endif
63 
64 #include <pcl/io/boost.h>
65 
66 #include <pcl/io/ply/ply.h>
68 #include <pcl/pcl_macros.h>
69 
70 namespace pcl
71 {
72  namespace io
73  {
74  namespace ply
75  {
76  /** Class ply_parser parses a PLY file and generates appropriate atomic
77  * parsers for the body.
78  * \author Ares Lagae as part of libply, Nizar Sallem
79  * Ported with agreement from the author under the terms of the BSD
80  * license.
81  */
82  class PCL_EXPORTS ply_parser
83  {
84  public:
85 
86  typedef boost::function<void (std::size_t, const std::string&)> info_callback_type;
87  typedef boost::function<void (std::size_t, const std::string&)> warning_callback_type;
88  typedef boost::function<void (std::size_t, const std::string&)> error_callback_type;
89 
90  typedef boost::function<void ()> magic_callback_type;
91  typedef boost::function<void (format_type, const std::string&)> format_callback_type;
92  typedef boost::function<void (const std::string&)> comment_callback_type;
93  typedef boost::function<void (const std::string&)> obj_info_callback_type;
94  typedef boost::function<bool ()> end_header_callback_type;
95 
96  typedef boost::function<void ()> begin_element_callback_type;
97  typedef boost::function<void ()> end_element_callback_type;
98  typedef boost::tuple<begin_element_callback_type, end_element_callback_type> element_callbacks_type;
99  typedef boost::function<element_callbacks_type (const std::string&, std::size_t)> element_definition_callback_type;
100 
101  template <typename ScalarType>
103  {
104  typedef boost::function<void (ScalarType)> type;
105  };
106 
107  template <typename ScalarType>
109  {
111  typedef boost::function<scalar_property_callback_type (const std::string&, const std::string&)> type;
112  };
113 
114  typedef boost::mpl::vector<int8, int16, int32, uint8, uint16, uint32, float32, float64> scalar_types;
115 
117  {
118  private:
119  template <typename T>
120  struct callbacks_element
121  {
122 // callbacks_element () : callback ();
123  typedef T scalar_type;
125  };
126 
127  typedef boost::mpl::inherit_linearly<
128  scalar_types,
129  boost::mpl::inherit<
130  boost::mpl::_1,
131  callbacks_element<boost::mpl::_2>
132  >
133  >::type callbacks;
134  callbacks callbacks_;
135 
136  public:
137  template <typename ScalarType>
139  get () const
140  {
141  return (static_cast<const callbacks_element<ScalarType>&> (callbacks_).callback);
142  }
143 
144  template <typename ScalarType>
146  get ()
147  {
148  return (static_cast<callbacks_element<ScalarType>&> (callbacks_).callback);
149  }
150 
151  template <typename ScalarType>
153  at (scalar_property_definition_callbacks_type& scalar_property_definition_callbacks);
154 
155  template <typename ScalarType>
157  at (const scalar_property_definition_callbacks_type& scalar_property_definition_callbacks);
158  };
159 
160  template <typename ScalarType> static
161  typename scalar_property_definition_callback_type<ScalarType>::type&
162  at (scalar_property_definition_callbacks_type& scalar_property_definition_callbacks)
163  {
164  return (scalar_property_definition_callbacks.get<ScalarType> ());
165  }
166 
167 
168  template <typename ScalarType> static
169  const typename scalar_property_definition_callback_type<ScalarType>::type&
170  at (const scalar_property_definition_callbacks_type& scalar_property_definition_callbacks)
171  {
172  return (scalar_property_definition_callbacks.get<ScalarType> ());
173  }
174 
175  template <typename SizeType, typename ScalarType>
177  {
178  typedef boost::function<void (SizeType)> type;
179  };
180 
181  template <typename SizeType, typename ScalarType>
183  {
184  typedef boost::function<void (ScalarType)> type;
185  };
186 
187  template <typename SizeType, typename ScalarType>
189  {
190  typedef boost::function<void ()> type;
191  };
192 
193  template <typename SizeType, typename ScalarType>
195  {
199  typedef boost::function<
200  boost::tuple<
204  > (const std::string&, const std::string&)> type;
205  };
206 
207  typedef boost::mpl::vector<uint8, uint16, uint32> size_types;
208 
210  {
211  private:
212  template <typename T> struct pair_with : boost::mpl::pair<T,boost::mpl::_> {};
213  template<typename Sequence1, typename Sequence2>
214 
215  struct sequence_product :
216  boost::mpl::fold<Sequence1, boost::mpl::vector0<>,
217  boost::mpl::joint_view<
218  boost::mpl::_1,boost::mpl::transform<Sequence2, pair_with<boost::mpl::_2> > > >
219  {};
220 
221  template <typename T>
222  struct callbacks_element
223  {
224  typedef typename T::first size_type;
225  typedef typename T::second scalar_type;
227  };
228 
229  typedef boost::mpl::inherit_linearly<sequence_product<size_types, scalar_types>::type, boost::mpl::inherit<boost::mpl::_1, callbacks_element<boost::mpl::_2> > >::type callbacks;
230  callbacks callbacks_;
231 
232  public:
233  template <typename SizeType, typename ScalarType>
235  get ()
236  {
237  return (static_cast<callbacks_element<boost::mpl::pair<SizeType, ScalarType> >&> (callbacks_).callback);
238  }
239 
240  template <typename SizeType, typename ScalarType>
242  get () const
243  {
244  return (static_cast<const callbacks_element<boost::mpl::pair<SizeType, ScalarType> >&> (callbacks_).callback);
245  }
246 
247  template <typename SizeType, typename ScalarType>
249  at (list_property_definition_callbacks_type& list_property_definition_callbacks);
250 
251  template <typename SizeType, typename ScalarType>
253  at (const list_property_definition_callbacks_type& list_property_definition_callbacks);
254  };
255 
256  template <typename SizeType, typename ScalarType> static
257  typename list_property_definition_callback_type<SizeType, ScalarType>::type&
258  at (list_property_definition_callbacks_type& list_property_definition_callbacks)
259  {
260  return (list_property_definition_callbacks.get<SizeType, ScalarType> ());
261  }
262 
263  template <typename SizeType, typename ScalarType> static
264  const typename list_property_definition_callback_type<SizeType, ScalarType>::type&
265  at (const list_property_definition_callbacks_type& list_property_definition_callbacks)
266  {
267  return (list_property_definition_callbacks.get<SizeType, ScalarType> ());
268  }
269 
270 
271  inline void
272  info_callback (const info_callback_type& info_callback);
273 
274  inline void
275  warning_callback (const warning_callback_type& warning_callback);
276 
277  inline void
278  error_callback (const error_callback_type& error_callback);
279 
280  inline void
281  magic_callback (const magic_callback_type& magic_callback);
282 
283  inline void
284  format_callback (const format_callback_type& format_callback);
285 
286  inline void
287  element_definition_callback (const element_definition_callback_type& element_definition_callback);
288 
289  inline void
290  scalar_property_definition_callbacks (const scalar_property_definition_callbacks_type& scalar_property_definition_callbacks);
291 
292  inline void
293  list_property_definition_callbacks (const list_property_definition_callbacks_type& list_property_definition_callbacks);
294 
295  inline void
296  comment_callback (const comment_callback_type& comment_callback);
297 
298  inline void
299  obj_info_callback (const obj_info_callback_type& obj_info_callback);
300 
301  inline void
302  end_header_callback (const end_header_callback_type& end_header_callback);
303 
304  typedef int flags_type;
305  enum flags { };
306 
308  comment_callback_ (), obj_info_callback_ (), end_header_callback_ (),
309  line_number_ (0), current_element_ ()
310  {}
311 
312  bool parse (const std::string& filename);
313  //inline bool parse (const std::string& filename);
314 
315  private:
316 
317  struct property
318  {
319  property (const std::string& name) : name (name) {}
320  virtual ~property () {}
321  virtual bool parse (class ply_parser& ply_parser, format_type format, std::istream& istream) = 0;
322  std::string name;
323  };
324 
325  template <typename ScalarType>
326  struct scalar_property : public property
327  {
328  typedef ScalarType scalar_type;
329  typedef typename scalar_property_callback_type<scalar_type>::type callback_type;
330  scalar_property (const std::string& name, callback_type callback)
331  : property (name)
332  , callback (callback)
333  {}
334  bool parse (class ply_parser& ply_parser,
336  std::istream& istream)
337  {
338  return ply_parser.parse_scalar_property<scalar_type> (format, istream, callback);
339  }
340  callback_type callback;
341  };
342 
343  template <typename SizeType, typename ScalarType>
344  struct list_property : public property
345  {
346  typedef SizeType size_type;
347  typedef ScalarType scalar_type;
348  typedef typename list_property_begin_callback_type<size_type, scalar_type>::type begin_callback_type;
349  typedef typename list_property_element_callback_type<size_type, scalar_type>::type element_callback_type;
350  typedef typename list_property_end_callback_type<size_type, scalar_type>::type end_callback_type;
351  list_property (const std::string& name,
352  begin_callback_type begin_callback,
353  element_callback_type element_callback,
354  end_callback_type end_callback)
355  : property (name)
356  , begin_callback (begin_callback)
357  , element_callback (element_callback)
358  , end_callback (end_callback)
359  {}
360  bool parse (class ply_parser& ply_parser,
362  std::istream& istream)
363  {
364  return ply_parser.parse_list_property<size_type, scalar_type> (format,
365  istream,
366  begin_callback,
367  element_callback,
368  end_callback);
369  }
370  begin_callback_type begin_callback;
371  element_callback_type element_callback;
372  end_callback_type end_callback;
373  };
374 
375  struct element
376  {
377  element (const std::string& name,
378  std::size_t count,
379  const begin_element_callback_type& begin_element_callback,
380  const end_element_callback_type& end_element_callback)
381  : name (name)
382  , count (count)
383  , begin_element_callback (begin_element_callback)
384  , end_element_callback (end_element_callback)
385  , properties ()
386  {}
387  std::string name;
388  std::size_t count;
389  begin_element_callback_type begin_element_callback;
390  end_element_callback_type end_element_callback;
391  std::vector<boost::shared_ptr<property> > properties;
392  };
393 
394  info_callback_type info_callback_;
395  warning_callback_type warning_callback_;
396  error_callback_type error_callback_;
397 
398  magic_callback_type magic_callback_;
399  format_callback_type format_callback_;
400  element_definition_callback_type element_definition_callbacks_;
401  scalar_property_definition_callbacks_type scalar_property_definition_callbacks_;
402  list_property_definition_callbacks_type list_property_definition_callbacks_;
403  comment_callback_type comment_callback_;
404  obj_info_callback_type obj_info_callback_;
405  end_header_callback_type end_header_callback_;
406 
407  template <typename ScalarType> inline void
408  parse_scalar_property_definition (const std::string& property_name);
409 
410  template <typename SizeType, typename ScalarType> inline void
411  parse_list_property_definition (const std::string& property_name);
412 
413  template <typename ScalarType> inline bool
414  parse_scalar_property (format_type format,
415  std::istream& istream,
416  const typename scalar_property_callback_type<ScalarType>::type& scalar_property_callback);
417 
418  template <typename SizeType, typename ScalarType> inline bool
419  parse_list_property (format_type format,
420  std::istream& istream,
421  const typename list_property_begin_callback_type<SizeType, ScalarType>::type& list_property_begin_callback,
422  const typename list_property_element_callback_type<SizeType, ScalarType>::type& list_property_element_callback,
423  const typename list_property_end_callback_type<SizeType, ScalarType>::type& list_property_end_callback);
424 
425  std::size_t line_number_;
426  element* current_element_;
427  };
428  } // namespace ply
429  } // namespace io
430 } // namespace pcl
431 
432 /* inline bool pcl::io::ply::ply_parser::parse (const std::string& filename) */
433 /* { */
434 /* std::ifstream ifstream (filename.c_str ()); */
435 /* return (parse (ifstream)); */
436 /* } */
437 
439 {
440  info_callback_ = info_callback;
441 }
442 
444 {
445  warning_callback_ = warning_callback;
446 }
447 
449 {
450  error_callback_ = error_callback;
451 }
452 
454 {
455  magic_callback_ = magic_callback;
456 }
457 
459 {
460  format_callback_ = format_callback;
461 }
462 
464 {
465  element_definition_callbacks_ = element_definition_callback;
466 }
467 
469 {
470  scalar_property_definition_callbacks_ = scalar_property_definition_callbacks;
471 }
472 
474 {
475  list_property_definition_callbacks_ = list_property_definition_callbacks;
476 }
477 
479 {
480  comment_callback_ = comment_callback;
481 }
482 
484 {
485  obj_info_callback_ = obj_info_callback;
486 }
487 
489 {
490  end_header_callback_ = end_header_callback;
491 }
492 
493 template <typename ScalarType>
494 inline void pcl::io::ply::ply_parser::parse_scalar_property_definition (const std::string& property_name)
495 {
496  typedef ScalarType scalar_type;
497  typename scalar_property_definition_callback_type<scalar_type>::type& scalar_property_definition_callback =
498  scalar_property_definition_callbacks_.get<scalar_type> ();
499  typename scalar_property_callback_type<scalar_type>::type scalar_property_callback;
500  if (scalar_property_definition_callback)
501  {
502  scalar_property_callback = scalar_property_definition_callback (current_element_->name, property_name);
503  }
504  if (!scalar_property_callback)
505  {
506  if (warning_callback_)
507  {
508  warning_callback_ (line_number_,
509  "property '" + std::string (type_traits<scalar_type>::name ()) + " " +
510  property_name + "' of element '" + current_element_->name + "' is not handled");
511  }
512  }
513  current_element_->properties.push_back (boost::shared_ptr<property> (new scalar_property<scalar_type> (property_name, scalar_property_callback)));
514 }
515 
516 template <typename SizeType, typename ScalarType>
517 inline void pcl::io::ply::ply_parser::parse_list_property_definition (const std::string& property_name)
518 {
519  typedef SizeType size_type;
520  typedef ScalarType scalar_type;
521  typedef typename list_property_definition_callback_type<size_type, scalar_type>::type list_property_definition_callback_type;
522  list_property_definition_callback_type& list_property_definition_callback = list_property_definition_callbacks_.get<size_type, scalar_type> ();
523  typedef typename list_property_begin_callback_type<size_type, scalar_type>::type list_property_begin_callback_type;
524  typedef typename list_property_element_callback_type<size_type, scalar_type>::type list_property_element_callback_type;
525  typedef typename list_property_end_callback_type<size_type, scalar_type>::type list_property_end_callback_type;
526  boost::tuple<list_property_begin_callback_type, list_property_element_callback_type, list_property_end_callback_type> list_property_callbacks;
527  if (list_property_definition_callback)
528  {
529  list_property_callbacks = list_property_definition_callback (current_element_->name, property_name);
530  }
531  if (!boost::get<0> (list_property_callbacks) || !boost::get<1> (list_property_callbacks) || !boost::get<2> (list_property_callbacks))
532  {
533  if (warning_callback_)
534  {
535  warning_callback_ (line_number_,
536  "property 'list " + std::string (type_traits<size_type>::name ()) + " " +
537  std::string (type_traits<scalar_type>::name ()) + " " +
538  property_name + "' of element '" +
539  current_element_->name + "' is not handled");
540  }
541  }
542  current_element_->properties.push_back (boost::shared_ptr<property> (
543  new list_property<size_type, scalar_type> (
544  property_name,
545  boost::get<0> (list_property_callbacks),
546  boost::get<1> (list_property_callbacks),
547  boost::get<2> (list_property_callbacks))));
548 }
549 
550 template <typename ScalarType>
551 inline bool pcl::io::ply::ply_parser::parse_scalar_property (format_type format,
552  std::istream& istream,
553  const typename scalar_property_callback_type<ScalarType>::type& scalar_property_callback)
554 {
555  using namespace io_operators;
556  typedef ScalarType scalar_type;
557  if (format == ascii_format)
558  {
559  std::string value_s;
560  scalar_type value;
561  char space = ' ';
562  istream >> value_s;
563  try
564  {
565  value = static_cast<scalar_type> (boost::lexical_cast<typename pcl::io::ply::type_traits<scalar_type>::parse_type> (value_s));
566  }
567  catch (boost::bad_lexical_cast &)
568  {
569  value = std::numeric_limits<scalar_type>::quiet_NaN ();
570  }
571 
572  if (!istream.eof ())
573  istream >> space >> std::ws;
574  if (!istream || !isspace (space))
575  {
576  if (error_callback_)
577  error_callback_ (line_number_, "parse error");
578  return (false);
579  }
580  if (scalar_property_callback)
581  scalar_property_callback (value);
582  return (true);
583  }
584  else
585  {
586  scalar_type value = std::numeric_limits<scalar_type>::quiet_NaN ();
587  istream.read (reinterpret_cast<char*> (&value), sizeof (scalar_type));
588  if (!istream)
589  {
590  if (error_callback_)
591  error_callback_ (line_number_, "parse error");
592  return (false);
593  }
594  if (((format == binary_big_endian_format) && (host_byte_order == little_endian_byte_order)) ||
595  ((format == binary_little_endian_format) && (host_byte_order == big_endian_byte_order)))
596  swap_byte_order (value);
597  if (scalar_property_callback)
598  scalar_property_callback (value);
599  return (true);
600  }
601 }
602 
603 template <typename SizeType, typename ScalarType>
604 inline bool pcl::io::ply::ply_parser::parse_list_property (format_type format, std::istream& istream,
605  const typename list_property_begin_callback_type<SizeType, ScalarType>::type& list_property_begin_callback,
606  const typename list_property_element_callback_type<SizeType, ScalarType>::type& list_property_element_callback,
607  const typename list_property_end_callback_type<SizeType, ScalarType>::type& list_property_end_callback)
608 {
609  using namespace io_operators;
610  typedef SizeType size_type;
611  typedef ScalarType scalar_type;
612  if (format == ascii_format)
613  {
614  size_type size = std::numeric_limits<size_type>::infinity ();
615  char space = ' ';
616  istream >> size;
617  if (!istream.eof ())
618  {
619  istream >> space >> std::ws;
620  }
621  if (!istream || !isspace (space))
622  {
623  if (error_callback_)
624  {
625  error_callback_ (line_number_, "parse error");
626  }
627  return (false);
628  }
629  if (list_property_begin_callback)
630  {
631  list_property_begin_callback (size);
632  }
633  for (std::size_t index = 0; index < size; ++index)
634  {
635  std::string value_s;
636  scalar_type value;
637  char space = ' ';
638  istream >> value_s;
639  try
640  {
641  value = static_cast<scalar_type> (boost::lexical_cast<typename pcl::io::ply::type_traits<scalar_type>::parse_type> (value_s));
642  }
643  catch (boost::bad_lexical_cast &)
644  {
645  value = std::numeric_limits<scalar_type>::quiet_NaN ();
646  }
647 
648  if (!istream.eof ())
649  {
650  istream >> space >> std::ws;
651  }
652  if (!istream || !isspace (space))
653  {
654  if (error_callback_)
655  {
656  error_callback_ (line_number_, "parse error");
657  }
658  return (false);
659  }
660  if (list_property_element_callback)
661  {
662  list_property_element_callback (value);
663  }
664  }
665  if (list_property_end_callback)
666  {
667  list_property_end_callback ();
668  }
669  return (true);
670  }
671  else
672  {
673  size_type size = std::numeric_limits<size_type>::infinity ();
674  istream.read (reinterpret_cast<char*> (&size), sizeof (size_type));
675  if (((format == binary_big_endian_format) && (host_byte_order == little_endian_byte_order)) ||
676  ((format == binary_little_endian_format) && (host_byte_order == big_endian_byte_order)))
677  {
678  swap_byte_order (size);
679  }
680  if (!istream)
681  {
682  if (error_callback_)
683  {
684  error_callback_ (line_number_, "parse error");
685  }
686  return (false);
687  }
688  if (list_property_begin_callback)
689  {
690  list_property_begin_callback (size);
691  }
692  for (std::size_t index = 0; index < size; ++index) {
693  scalar_type value = std::numeric_limits<scalar_type>::quiet_NaN ();
694  istream.read (reinterpret_cast<char*> (&value), sizeof (scalar_type));
695  if (!istream) {
696  if (error_callback_) {
697  error_callback_ (line_number_, "parse error");
698  }
699  return (false);
700  }
701  if (((format == binary_big_endian_format) && (host_byte_order == little_endian_byte_order)) ||
702  ((format == binary_little_endian_format) && (host_byte_order == big_endian_byte_order)))
703  {
704  swap_byte_order (value);
705  }
706  if (list_property_element_callback)
707  {
708  list_property_element_callback (value);
709  }
710  }
711  if (list_property_end_callback)
712  {
713  list_property_end_callback ();
714  }
715  return (true);
716  }
717 }
718 
719 #ifdef BUILD_Maintainer
720 # if defined __GNUC__
721 # if __GNUC__ == 4 && __GNUC_MINOR__ > 3
722 # pragma GCC diagnostic warning "-Weffc++"
723 # pragma GCC diagnostic warning "-pedantic"
724 # endif
725 # elif defined _MSC_VER
726 # pragma warning(pop)
727 # endif
728 #endif
729 
730 #endif // PCL_IO_PLY_PLY_PARSER_H
pcl
This file defines compatibility wrappers for low level I/O functions.
Definition: convolution.h:45
pcl::io::ply::ply_parser::size_types
boost::mpl::vector< uint8, uint16, uint32 > size_types
Definition: ply_parser.h:207
pcl::io::ply::ascii_format
@ ascii_format
Definition: ply.h:99
pcl::io::ply::ply_parser::info_callback_type
boost::function< void(std::size_t, const std::string &)> info_callback_type
Definition: ply_parser.h:86
pcl::io::ply::ply_parser::warning_callback
void warning_callback(const warning_callback_type &warning_callback)
Definition: ply_parser.h:443
pcl::io::ply::little_endian_byte_order
@ little_endian_byte_order
Definition: byte_order.h:59
pcl::io::ply::ply_parser::scalar_property_definition_callback_type::type
boost::function< scalar_property_callback_type(const std::string &, const std::string &)> type
Definition: ply_parser.h:111
pcl::io::ply::ply_parser::at
static const list_property_definition_callback_type< SizeType, ScalarType >::type & at(const list_property_definition_callbacks_type &list_property_definition_callbacks)
Definition: ply_parser.h:265
pcl::io::ply::ply_parser::ply_parser
ply_parser()
Definition: ply_parser.h:307
pcl::io::ply::format
format
Definition: ply.h:99
pcl::io::ply::ply_parser::list_property_end_callback_type
Definition: ply_parser.h:188
pcl::io::ply::ply_parser::list_property_definition_callback_type< size_type, scalar_type >::type
boost::function< boost::tuple< list_property_begin_callback_type, list_property_element_callback_type, list_property_end_callback_type >const std::string &, const std::string &)> type
Definition: ply_parser.h:204
ply.h
pcl::io::ply::ply_parser::magic_callback
void magic_callback(const magic_callback_type &magic_callback)
Definition: ply_parser.h:453
pcl::io::ply::ply_parser::at
static scalar_property_definition_callback_type< ScalarType >::type & at(scalar_property_definition_callbacks_type &scalar_property_definition_callbacks)
Definition: ply_parser.h:162
pcl::io::ply::big_endian_byte_order
@ big_endian_byte_order
Definition: byte_order.h:60
pcl::io::ply::ply_parser::list_property_definition_callbacks_type::get
const list_property_definition_callback_type< SizeType, ScalarType >::type & get() const
Definition: ply_parser.h:242
pcl::io::ply::ply_parser::list_property_definition_callback_type::list_property_end_callback_type
list_property_end_callback_type< SizeType, ScalarType >::type list_property_end_callback_type
Definition: ply_parser.h:198
pcl::io::ply::ply_parser::comment_callback
void comment_callback(const comment_callback_type &comment_callback)
Definition: ply_parser.h:478
pcl::io::ply::binary_big_endian_format
@ binary_big_endian_format
Definition: ply.h:99
pcl::io::ply::ply_parser::scalar_property_definition_callback_type
Definition: ply_parser.h:108
pcl::io::ply::ply_parser::begin_element_callback_type
boost::function< void()> begin_element_callback_type
Definition: ply_parser.h:96
pcl::io::ply::ply_parser::flags
flags
Definition: ply_parser.h:305
pcl::io::ply::ply_parser::list_property_definition_callback_type::list_property_begin_callback_type
list_property_begin_callback_type< SizeType, ScalarType >::type list_property_begin_callback_type
Definition: ply_parser.h:196
pcl::io::ply::ply_parser::list_property_definition_callback_type
Definition: ply_parser.h:194
pcl::io::ply::ply_parser::scalar_property_definition_callbacks
void scalar_property_definition_callbacks(const scalar_property_definition_callbacks_type &scalar_property_definition_callbacks)
Definition: ply_parser.h:468
pcl::io::ply::ply_parser::scalar_property_definition_callbacks_type
Definition: ply_parser.h:116
pcl::io::ply::ply_parser::format_callback_type
boost::function< void(format_type, const std::string &)> format_callback_type
Definition: ply_parser.h:91
pcl::io::ply::ply_parser::list_property_element_callback_type
Definition: ply_parser.h:182
pcl::io::ply::ply_parser::element_callbacks_type
boost::tuple< begin_element_callback_type, end_element_callback_type > element_callbacks_type
Definition: ply_parser.h:98
pcl::io::ply::ply_parser::info_callback
void info_callback(const info_callback_type &info_callback)
Definition: ply_parser.h:438
pcl::io::ply::ply_parser::scalar_types
boost::mpl::vector< int8, int16, int32, uint8, uint16, uint32, float32, float64 > scalar_types
Definition: ply_parser.h:114
pcl::console::parse
int parse(int argc, const char *const *argv, const char *argument_name, Type &value)
Template version for parsing arguments.
Definition: parse.h:78
pcl::io::ply::ply_parser::at
static list_property_definition_callback_type< SizeType, ScalarType >::type & at(list_property_definition_callbacks_type &list_property_definition_callbacks)
Definition: ply_parser.h:258
pcl::io::ply::ply_parser::comment_callback_type
boost::function< void(const std::string &)> comment_callback_type
Definition: ply_parser.h:92
pcl::io::ply::ply_parser::element_definition_callback_type
boost::function< element_callbacks_type(const std::string &, std::size_t)> element_definition_callback_type
Definition: ply_parser.h:99
pcl::io::ply::ply_parser::list_property_begin_callback_type::type
boost::function< void(SizeType)> type
Definition: ply_parser.h:178
pcl::io::ply::ply_parser::scalar_property_definition_callbacks_type::get
scalar_property_definition_callback_type< ScalarType >::type & get()
Definition: ply_parser.h:146
pcl::io::ply::ply_parser::list_property_end_callback_type::type
boost::function< void()> type
Definition: ply_parser.h:190
pcl::io::ply::ply_parser::list_property_begin_callback_type
Definition: ply_parser.h:176
pcl::io::ply::format_type
int format_type
Definition: ply.h:98
pcl::io::ply::ply_parser
Class ply_parser parses a PLY file and generates appropriate atomic parsers for the body.
Definition: ply_parser.h:82
pcl::io::ply::ply_parser::list_property_definition_callbacks_type::get
list_property_definition_callback_type< SizeType, ScalarType >::type & get()
Definition: ply_parser.h:235
pcl::io::ply::ply_parser::format_callback
void format_callback(const format_callback_type &format_callback)
Definition: ply_parser.h:458
pcl::io::ply::ply_parser::magic_callback_type
boost::function< void()> magic_callback_type
Definition: ply_parser.h:90
pcl::io::ply::ply_parser::obj_info_callback
void obj_info_callback(const obj_info_callback_type &obj_info_callback)
Definition: ply_parser.h:483
pcl::io::ply::ply_parser::list_property_element_callback_type::type
boost::function< void(ScalarType)> type
Definition: ply_parser.h:184
pcl::io::ply::swap_byte_order
void swap_byte_order(char *bytes)
pcl::io::ply::ply_parser::list_property_definition_callback_type::list_property_element_callback_type
list_property_element_callback_type< SizeType, ScalarType >::type list_property_element_callback_type
Definition: ply_parser.h:197
pcl::io::ply::ply_parser::scalar_property_callback_type::type
boost::function< void(ScalarType)> type
Definition: ply_parser.h:104
pcl::io::ply::ply_parser::end_element_callback_type
boost::function< void()> end_element_callback_type
Definition: ply_parser.h:97
pcl::io::ply::ply_parser::end_header_callback_type
boost::function< bool()> end_header_callback_type
Definition: ply_parser.h:94
io_operators.h
pcl::io::ply::ply_parser::scalar_property_definition_callbacks_type::get
const scalar_property_definition_callback_type< ScalarType >::type & get() const
Definition: ply_parser.h:139
pcl::io::ply::ply_parser::error_callback
void error_callback(const error_callback_type &error_callback)
Definition: ply_parser.h:448
pcl::io::ply::ply_parser::scalar_property_definition_callback_type::scalar_property_callback_type
scalar_property_callback_type< ScalarType >::type scalar_property_callback_type
Definition: ply_parser.h:110
pcl::io::ply::ply_parser::at
static const scalar_property_definition_callback_type< ScalarType >::type & at(const scalar_property_definition_callbacks_type &scalar_property_definition_callbacks)
Definition: ply_parser.h:170
pcl::io::ply::ply_parser::list_property_definition_callbacks
void list_property_definition_callbacks(const list_property_definition_callbacks_type &list_property_definition_callbacks)
Definition: ply_parser.h:473
pcl::io::ply::ply_parser::list_property_definition_callbacks_type
Definition: ply_parser.h:209
pcl::io::ply::ply_parser::end_header_callback
void end_header_callback(const end_header_callback_type &end_header_callback)
Definition: ply_parser.h:488
pcl::io::ply::ply_parser::flags_type
int flags_type
Definition: ply_parser.h:304
pcl::io::ply::binary_little_endian_format
@ binary_little_endian_format
Definition: ply.h:99
pcl::io::ply::ply_parser::element_definition_callback
void element_definition_callback(const element_definition_callback_type &element_definition_callback)
Definition: ply_parser.h:463
pcl::io::ply::ply_parser::warning_callback_type
boost::function< void(std::size_t, const std::string &)> warning_callback_type
Definition: ply_parser.h:87
pcl::io::ply::ply_parser::scalar_property_callback_type
Definition: ply_parser.h:102
pcl::io::ply::ply_parser::obj_info_callback_type
boost::function< void(const std::string &)> obj_info_callback_type
Definition: ply_parser.h:93
pcl::io::ply::ply_parser::error_callback_type
boost::function< void(std::size_t, const std::string &)> error_callback_type
Definition: ply_parser.h:88