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