Developer Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
OMFormat.hh
1 /* ========================================================================= *
2  * *
3  * OpenMesh *
4  * Copyright (c) 2001-2015, RWTH-Aachen University *
5  * Department of Computer Graphics and Multimedia *
6  * All rights reserved. *
7  * www.openmesh.org *
8  * *
9  *---------------------------------------------------------------------------*
10  * This file is part of OpenMesh. *
11  *---------------------------------------------------------------------------*
12  * *
13  * Redistribution and use in source and binary forms, with or without *
14  * modification, are permitted provided that the following conditions *
15  * are met: *
16  * *
17  * 1. Redistributions of source code must retain the above copyright notice, *
18  * this list of conditions and the following disclaimer. *
19  * *
20  * 2. Redistributions in binary form must reproduce the above copyright *
21  * notice, this list of conditions and the following disclaimer in the *
22  * documentation and/or other materials provided with the distribution. *
23  * *
24  * 3. Neither the name of the copyright holder nor the names of its *
25  * contributors may be used to endorse or promote products derived from *
26  * this software without specific prior written permission. *
27  * *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
29  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
30  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
31  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
32  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
33  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
34  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
35  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
36  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
37  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
38  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
39  * *
40  * ========================================================================= */
41 
42 /*===========================================================================*\
43  * *
44  * $Revision$ *
45  * $Date$ *
46  * *
47 \*===========================================================================*/
48 
49 
50 #ifndef OPENMESH_IO_OMFORMAT_HH
51 #define OPENMESH_IO_OMFORMAT_HH
52 
53 
54 //=== INCLUDES ================================================================
55 
58 #include <OpenMesh/Core/IO/SR_store.hh>
59 #include <OpenMesh/Core/Utils/GenProg.hh>
60 #include <OpenMesh/Core/Utils/Endian.hh>
61 #include <OpenMesh/Core/Utils/vector_traits.hh>
62 // --------------------
63 #include <iostream>
64 #if defined(OM_CC_GCC) && (OM_GCC_VERSION < 30000)
66 # define OM_MISSING_HEADER_LIMITS 1
67 #else
68 # include <limits>
69 #endif
70 
71 
72 //== NAMESPACES ==============================================================
73 
74 #ifndef DOXY_IGNORE_THIS
75 namespace OpenMesh {
76 namespace IO {
77 namespace OMFormat {
78 
79 
80 //=== IMPLEMENTATION ==========================================================
81 
82 
86 
87 //-----------------------------------------------------------------------------
88 
89  // <:Header>
90  // <:Comment>
91  // Chunk 0
92  // <:ChunkHeader>
93  // <:Comment>
94  // data
95  // Chunk 1
96  // <:ChunkHeader>
97  // <:Comment>
98  // data
99  // .
100  // .
101  // .
102  // Chunk N
103 
104  //
105  // NOTICE!
106  //
107  // The usage of data types who differ in size
108  // on different pc architectures (32/64 bit) and/or
109  // operating systems, e.g. (unsigned) long, size_t,
110  // is not recommended because of inconsistencies
111  // in case of cross writing and reading.
112  //
113  // Basic types that are supported are:
114 
115 
116  typedef unsigned char uchar;
117  typedef uint8_t uint8;
118  typedef uint16_t uint16;
119  typedef uint32_t uint32;
120  typedef uint64_t uint64;
121  typedef int8_t int8;
122  typedef int16_t int16;
123  typedef int32_t int32;
124  typedef int64_t int64;
125  typedef float32_t float32;
126  typedef float64_t float64;
127 
128  struct Header
129  {
130  uchar magic_[2]; // OM
131  uchar mesh_; // [T]riangles, [Q]uads, [P]olygonals
132  uint8 version_;
133  uint32 n_vertices_;
134  uint32 n_faces_;
135  uint32 n_edges_;
136 
137  size_t store( std::ostream& _os, bool _swap ) const
138  {
139  _os.write( (char*)this, 4); // magic_, mesh_, version_
140  size_t bytes = 4;
141  bytes += binary<uint32_t>::store( _os, n_vertices_, _swap );
142  bytes += binary<uint32_t>::store( _os, n_faces_, _swap );
143  bytes += binary<uint32_t>::store( _os, n_edges_, _swap );
144  return bytes;
145  }
146 
147  size_t restore( std::istream& _is, bool _swap )
148  {
149  if (_is.read( (char*)this, 4 ).eof())
150  return 0;
151 
152  size_t bytes = 4;
153  bytes += binary<uint32_t>::restore( _is, n_vertices_, _swap );
154  bytes += binary<uint32_t>::restore( _is, n_faces_, _swap );
155  bytes += binary<uint32_t>::restore( _is, n_edges_, _swap );
156  return bytes;
157  }
158 
159  };
160 
161  struct Chunk
162  {
163  // Hardcoded this size to an uint32 to make the system 32/64 bit compatible.
164  // Needs further investigation!
165  typedef uint32 esize_t; // element size, used for custom properties
166 
167  enum Type {
168  Type_Pos = 0x00,
169  Type_Normal = 0x01,
170  Type_Texcoord = 0x02,
171  Type_Status = 0x03,
172  Type_Color = 0x04,
173  Type_Custom = 0x06,
174  Type_Topology = 0x07
175  };
176 
177  enum Entity {
178  Entity_Vertex = 0x00,
179  Entity_Mesh = 0x01,
180  Entity_Face = 0x02,
181  Entity_Edge = 0x04,
182  Entity_Halfedge = 0x06
183  };
184 
185  enum Dim {
186  Dim_1D = 0x00,
187  Dim_2D = 0x01,
188  Dim_3D = 0x02,
189  Dim_4D = 0x03,
190  Dim_5D = 0x04,
191  Dim_6D = 0x05,
192  Dim_7D = 0x06,
193  Dim_8D = 0x07
194  };
195 
196  enum Integer_Size {
197  Integer_8 = 0x00, // 1 byte for (unsigned) char
198  Integer_16 = 0x01, // 2 bytes for short
199  Integer_32 = 0x02, // 4 bytes for long
200  Integer_64 = 0x03 // 8 bytes for long long
201  };
202 
203  enum Float_Size {
204  Float_32 = 0x00, // 4 bytes for float
205  Float_64 = 0x01, // 8 bytes for double
206  Float_128 = 0x02 // 16 bytes for long double (an assumption!)
207  };
208 
209  static const int SIZE_RESERVED = 1; // 1
210  static const int SIZE_NAME = 1; // 2
211  static const int SIZE_ENTITY = 3; // 5
212  static const int SIZE_TYPE = 4; // 9
213 
214  static const int SIZE_SIGNED = 1; // 10
215  static const int SIZE_FLOAT = 1; // 11
216  static const int SIZE_DIM = 3; // 14
217  static const int SIZE_BITS = 2; // 16
218 
219  static const int OFF_RESERVED = 0; // 0
220  static const int OFF_NAME = SIZE_RESERVED + OFF_RESERVED; // 2
221  static const int OFF_ENTITY = SIZE_NAME + OFF_NAME; // 3
222  static const int OFF_TYPE = SIZE_ENTITY + OFF_ENTITY; // 5
223  static const int OFF_SIGNED = SIZE_TYPE + OFF_TYPE; // 9
224  static const int OFF_FLOAT = SIZE_SIGNED + OFF_SIGNED; // 10
225  static const int OFF_DIM = SIZE_FLOAT + OFF_FLOAT; // 11
226  static const int OFF_BITS = SIZE_DIM + OFF_DIM; // 14
227 
228  // !Attention! When changing the bit size, the operators
229  // << (uint16, Header) and << (Header, uint16) must be changed as well
230  //
231  // Entries signed_, float_, dim_, bits_ are not used when type_
232  // equals Type_Custom
233  //
234  struct Header // 16 bits long
235  {
236  unsigned reserved_: SIZE_RESERVED;
237  unsigned name_ : SIZE_NAME; // 1 named property, 0 anonymous
238  unsigned entity_ : SIZE_ENTITY; // 0 vertex, 1 mesh, 2 edge,
239  // 4 halfedge, 6 face
240  unsigned type_ : SIZE_TYPE; // 0 pos, 1 normal, 2 texcoord,
241  // 3 status, 4 color 6 custom 7 topology
242  unsigned signed_ : SIZE_SIGNED; // bool
243  unsigned float_ : SIZE_FLOAT; // bool
244  unsigned dim_ : SIZE_DIM; // 0 1D, 1 2D, 2 3D, .., 7 8D
245  unsigned bits_ : SIZE_BITS; // {8, 16, 32, 64} | {32, 64, 128}
246  // (integer) (float)
247  unsigned unused_ : 16; // fill up to 32 bits
248  }; // struct Header
249 
250 
251  class PropertyName : public std::string
252  {
253  public:
254 
255  static const size_t size_max = 256;
256 
257  PropertyName( ) { }
258 
259  PropertyName( const std::string& _name ) { *this = _name; }
260 
261  bool is_valid() const { return is_valid( size() ); }
262 
263  static bool is_valid( size_t _s ) { return _s <= size_max; }
264 
265  PropertyName& operator = ( const std::string& _rhs )
266  {
267  assert( is_valid( _rhs.size() ) );
268 
269  if ( is_valid( _rhs.size() ) )
270  std::string::operator = ( _rhs );
271  else
272  {
273  omerr() << "Warning! Property name too long. Will be shortened!\n";
274  this->std::string::operator = ( _rhs.substr(0, size_max) );
275  }
276 
277  return *this;
278  }
279 
280  };
281 
282  }; // Chunk
283 
284  // ------------------------------------------------------------ Helper
285 
286  // -------------------- get size information
287 
289  inline size_t header_size(void) { return sizeof(Header); }
290 
291 
293  inline size_t chunk_header_size( void ) { return sizeof(uint16); }
294 
295 
297  inline size_t scalar_size( const Chunk::Header& _hdr )
298  {
299  return _hdr.float_ ? (0x01 << _hdr.bits_) : (0x04 << _hdr.bits_);
300  }
301 
302 
304  inline size_t dimensions(const Chunk::Header& _chdr) { return _chdr.dim_+1; }
305 
306 
308  inline size_t vector_size( const Chunk::Header& _chdr )
309  {
310  return dimensions(_chdr)*scalar_size(_chdr);
311  }
312 
313 
315  inline size_t chunk_data_size( Header& _hdr, Chunk::Header& _chunk_hdr )
316  {
317  size_t C = 0;
318 
319  switch( _chunk_hdr.entity_ )
320  {
321  case Chunk::Entity_Vertex: C = _hdr.n_vertices_; break;
322  case Chunk::Entity_Face: C = _hdr.n_faces_; break;
323  case Chunk::Entity_Halfedge: C = _hdr.n_edges_; // no break!
324  case Chunk::Entity_Edge: C += _hdr.n_edges_; break;
325  case Chunk::Entity_Mesh: C = 1; break;
326  default:
327  std::cerr << "Invalid value in _chunk_hdr.entity_\n";
328  assert( false );
329  break;
330  }
331 
332  return C * vector_size( _chunk_hdr );
333  }
334 
335  inline size_t chunk_size( Header& _hdr, Chunk::Header& _chunk_hdr )
336  {
337  return chunk_header_size() + chunk_data_size( _hdr, _chunk_hdr );
338  }
339 
340  // -------------------- convert from Chunk::Header to storage type
341 
342  uint16& operator << (uint16& val, const Chunk::Header& hdr);
343  Chunk::Header& operator << (Chunk::Header& hdr, const uint16 val);
344 
345 
346  // -------------------- type information
347 
348  template <typename T> bool is_float(const T&)
349  {
350 #if defined(OM_MISSING_HEADER_LIMITS)
351  return !Utils::NumLimitsT<T>::is_integer();
352 #else
353  return !std::numeric_limits<T>::is_integer;
354 #endif
355  }
356 
357  template <typename T> bool is_integer(const T)
358  {
359 #if defined(OM_MISSING_HEADER_LIMITS)
360  return Utils::NumLimitsT<T>::is_integer();
361 #else
362  return std::numeric_limits<T>::is_integer;
363 #endif
364  }
365 
366  template <typename T> bool is_signed(const T&)
367  {
368 #if defined(OM_MISSING_HEADER_LIMITS)
369  return Utils::NumLimitsT<T>::is_signed();
370 #else
371  return std::numeric_limits<T>::is_signed;
372 #endif
373  }
374 
375  // -------------------- conversions (format type <- type/value)
376 
377  template <typename VecType>
378  inline
379  Chunk::Dim dim( VecType )
380  {
381  assert( vector_traits< VecType >::size() < 9 );
382  return static_cast<Chunk::Dim>(vector_traits< VecType >::size() - 1);
383  }
384 
385  template <typename VecType>
386  inline
387  Chunk::Dim dim( const Chunk::Header& _hdr )
388  {
389  return static_cast<Chunk::Dim>( _hdr.dim_ );
390  }
391 
392  // calc minimum (power-of-2) number of bits needed
393  Chunk::Integer_Size needed_bits( size_t s );
394 
395  // Convert size of type to Integer_Size
396 #ifdef NDEBUG
397  template <typename T> Chunk::Integer_Size integer_size(const T&)
398 #else
399  template <typename T> Chunk::Integer_Size integer_size(const T& d)
400 #endif
401  {
402 #ifndef NDEBUG
403  assert( is_integer(d) );
404 #endif
405 
406  switch( sizeof(T) )
407  {
408  case 1: return OMFormat::Chunk::Integer_8;
409  case 2: return OMFormat::Chunk::Integer_16;
410  case 4: return OMFormat::Chunk::Integer_32;
411  case 8: return OMFormat::Chunk::Integer_64;
412  default:
413  std::cerr << "Invalid value in integer_size\n";
414  assert( false );
415  break;
416  }
417  return Chunk::Integer_Size(0);
418  }
419 
420 
421  // Convert size of type to FLoat_Size
422 #ifdef NDEBUG
423  template <typename T> Chunk::Float_Size float_size(const T&)
424 #else
425  template <typename T> Chunk::Float_Size float_size(const T& d)
426 #endif
427  {
428 #ifndef NDEBUG
429  assert( is_float(d) );
430 #endif
431 
432  switch( sizeof(T) )
433  {
434  case 4: return OMFormat::Chunk::Float_32;
435  case 8: return OMFormat::Chunk::Float_64;
436  case 16: return OMFormat::Chunk::Float_128;
437  default:
438  std::cerr << "Invalid value in float_size\n";
439  assert( false );
440  break;
441  }
442  return Chunk::Float_Size(0);
443  }
444 
445  // Return the storage type (Chunk::Header::bits_)
446  template <typename T>
447  inline
448  unsigned int bits(const T& val)
449  {
450  return is_integer(val)
451  ? (static_cast<unsigned int>(integer_size(val)))
452  : (static_cast<unsigned int>(float_size(val)));
453  }
454 
455  // -------------------- create/read version
456 
457  inline uint8 mk_version(const uint16 major, const uint16 minor)
458  { return (major & 0x07) << 5 | (minor & 0x1f); }
459 
460 
461  inline uint16 major_version(const uint8 version)
462  { return (version >> 5) & 0x07; }
463 
464 
465  inline uint16 minor_version(const uint8 version)
466  { return (version & 0x001f); }
467 
468 
469  // ---------------------------------------- convenience functions
470 
471  const char *as_string(Chunk::Type t);
472  const char *as_string(Chunk::Entity e);
473  const char *as_string(Chunk::Dim d);
474  const char *as_string(Chunk::Integer_Size d);
475  const char *as_string(Chunk::Float_Size d);
476 
477  std::ostream& operator << ( std::ostream& _os, const Header& _h );
478  std::ostream& operator << ( std::ostream& _os, const Chunk::Header& _c );
479 
481 } // namespace OMFormat
482 
483  // -------------------- (re-)store header
484 
485  template <> inline
486  size_t store( std::ostream& _os, const OMFormat::Header& _hdr, bool _swap)
487  { return _hdr.store( _os, _swap ); }
488 
489  template <> inline
490  size_t restore( std::istream& _is, OMFormat::Header& _hdr, bool _swap )
491  { return _hdr.restore( _is, _swap ); }
492 
493 
494  // -------------------- (re-)store chunk header
495 
496  template <> inline
497  size_t
498  store( std::ostream& _os, const OMFormat::Chunk::Header& _hdr, bool _swap)
499  {
500  OMFormat::uint16 val; val << _hdr;
501  return binary<uint16_t>::store( _os, val, _swap );
502  }
503 
504  template <> inline
505  size_t
506  restore( std::istream& _is, OMFormat::Chunk::Header& _hdr, bool _swap )
507  {
508  OMFormat::uint16 val;
509  size_t bytes = binary<uint16_t>::restore( _is, val, _swap );
510 
511  _hdr << val;
512 
513  return bytes;
514  }
515 
516  // -------------------- (re-)store integer with wanted number of bits (bytes)
517 
518  typedef GenProg::TrueType t_signed;
519  typedef GenProg::FalseType t_unsigned;
520 
521  // helper to store a an integer
522  template< typename T >
523  size_t
524  store( std::ostream& _os,
525  const T& _val,
526  OMFormat::Chunk::Integer_Size _b,
527  bool _swap,
528  t_signed);
529 
530  // helper to store a an unsigned integer
531  template< typename T >
532  size_t
533  store( std::ostream& _os,
534  const T& _val,
535  OMFormat::Chunk::Integer_Size _b,
536  bool _swap,
537  t_unsigned);
538 
540  template< typename T >
541  inline
542  size_t
543  store( std::ostream& _os,
544  const T& _val,
545  OMFormat::Chunk::Integer_Size _b,
546  bool _swap)
547  {
548  assert( OMFormat::is_integer( _val ) );
549 
550  if ( OMFormat::is_signed( _val ) )
551  return store( _os, _val, _b, _swap, t_signed() );
552  return store( _os, _val, _b, _swap, t_unsigned() );
553  }
554 
555  // helper to store a an integer
556  template< typename T > inline
557  size_t restore( std::istream& _is,
558  T& _val,
559  OMFormat::Chunk::Integer_Size _b,
560  bool _swap,
561  t_signed);
562 
563  // helper to store a an unsigned integer
564  template< typename T > inline
565  size_t restore( std::istream& _is,
566  T& _val,
567  OMFormat::Chunk::Integer_Size _b,
568  bool _swap,
569  t_unsigned);
570 
572  template< typename T >
573  inline
574  size_t
575  restore( std::istream& _is,
576  T& _val,
577  OMFormat::Chunk::Integer_Size _b,
578  bool _swap)
579  {
580  assert( OMFormat::is_integer( _val ) );
581 
582  if ( OMFormat::is_signed( _val ) )
583  return restore( _is, _val, _b, _swap, t_signed() );
584  return restore( _is, _val, _b, _swap, t_unsigned() );
585  }
586 
587 
588  //
589  // ---------------------------------------- storing vectors
590  template <typename VecT> inline
591  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<2>,
592  bool _swap )
593  {
594  size_t bytes = store( _os, _vec[0], _swap );
595  bytes += store( _os, _vec[1], _swap );
596  return bytes;
597  }
598 
599  template <typename VecT> inline
600  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<3>,
601  bool _swap )
602  {
603  size_t bytes = store( _os, _vec[0], _swap );
604  bytes += store( _os, _vec[1], _swap );
605  bytes += store( _os, _vec[2], _swap );
606  return bytes;
607  }
608 
609  template <typename VecT> inline
610  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<4>,
611  bool _swap )
612  {
613  size_t bytes = store( _os, _vec[0], _swap );
614  bytes += store( _os, _vec[1], _swap );
615  bytes += store( _os, _vec[2], _swap );
616  bytes += store( _os, _vec[3], _swap );
617  return bytes;
618  }
619 
620  template <typename VecT> inline
621  size_t store( std::ostream& _os, const VecT& _vec, GenProg::Int2Type<1>,
622  bool _swap )
623  {
624  return store( _os, _vec[0], _swap );
625  }
626 
628  template <typename VecT> inline
629  size_t vector_store( std::ostream& _os, const VecT& _vec, bool _swap )
630  {
631  return store( _os, _vec,
632  GenProg::Int2Type< vector_traits<VecT>::size_ >(),
633  _swap );
634  }
635 
636  // ---------------------------------------- restoring vectors
637  template <typename VecT>
638  inline
639  size_t
640  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<2>,
641  bool _swap )
642  {
643  size_t bytes = restore( _is, _vec[0], _swap );
644  bytes += restore( _is, _vec[1], _swap );
645  return bytes;
646  }
647 
648  template <typename VecT>
649  inline
650  size_t
651  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<3>,
652  bool _swap )
653  {
654  typedef typename vector_traits<VecT>::value_type scalar_type;
655  size_t bytes;
656 
657  bytes = binary<scalar_type>::restore( _is, _vec[0], _swap );
658  bytes += binary<scalar_type>::restore( _is, _vec[1], _swap );
659  bytes += binary<scalar_type>::restore( _is, _vec[2], _swap );
660  return bytes;
661  }
662 
663  template <typename VecT>
664  inline
665  size_t
666  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<4>,
667  bool _swap )
668  {
669  typedef typename vector_traits<VecT>::value_type scalar_type;
670  size_t bytes;
671 
672  bytes = binary<scalar_type>::restore( _is, _vec[0], _swap );
673  bytes += binary<scalar_type>::restore( _is, _vec[1], _swap );
674  bytes += binary<scalar_type>::restore( _is, _vec[2], _swap );
675  bytes += binary<scalar_type>::restore( _is, _vec[3], _swap );
676  return bytes;
677  }
678 
679  template <typename VecT>
680  inline
681  size_t
682  restore( std::istream& _is, VecT& _vec, GenProg::Int2Type<1>,
683  bool _swap )
684  {
685  return restore( _is, _vec[0], _swap );
686  }
687 
689  template <typename VecT>
690  inline
691  size_t
692  vector_restore( std::istream& _is, VecT& _vec, bool _swap )
693  {
694  return restore( _is, _vec,
695  GenProg::Int2Type< vector_traits<VecT>::size_ >(),
696  _swap );
697  }
698 
699 
700  // ---------------------------------------- storing property names
701 
702  template <>
703  inline
704  size_t store( std::ostream& _os, const OMFormat::Chunk::PropertyName& _pn,
705  bool _swap )
706  {
707  store( _os, _pn.size(), OMFormat::Chunk::Integer_8, _swap ); // 1 byte
708  if ( _pn.size() )
709  _os.write( _pn.c_str(), _pn.size() ); // size bytes
710  return _pn.size() + 1;
711  }
712 
713  template <>
714  inline
715  size_t restore( std::istream& _is, OMFormat::Chunk::PropertyName& _pn,
716  bool _swap )
717  {
718  size_t size;
719 
720  restore( _is, size, OMFormat::Chunk::Integer_8, _swap); // 1 byte
721 
722  assert( OMFormat::Chunk::PropertyName::is_valid( size ) );
723 
724  if ( size > 0 )
725  {
726  char buf[256];
727  _is.read( buf, size ); // size bytes
728  buf[size] = '\0';
729  _pn.resize(size);
730  _pn = buf;
731  }
732  return size+1;
733  }
734 
735 //=============================================================================
736 } // namespace IO
737 } // namespace OpenMesh
738 #endif
739 //=============================================================================
740 #if defined(OM_MISSING_HEADER_LIMITS)
741 # undef OM_MISSING_HEADER_LIMITS
742 #endif
743 //=============================================================================
744 #if defined(OM_INCLUDE_TEMPLATES) && !defined(OPENMESH_IO_OMFORMAT_CC)
745 # define OPENMESH_IO_OMFORMAT_TEMPLATES
746 # include "OMFormatT.cc"
747 #endif
748 //=============================================================================
749 #endif
750 //=============================================================================
auto operator<<(std::ostream &os, const VectorT< Scalar, DIM > &_vec) -> typename std::enable_if< sizeof(decltype(os<< _vec[0])) >=0
output a vector by printing its space-separated compontens
Definition: VectorT.hh:652
signed char int8_t
Definition: SR_types.hh:85
short int16_t
Definition: SR_types.hh:86
double float64_t
Definition: SR_types.hh:98
unsigned short uint16_t
Definition: SR_types.hh:86
static size_t size()
size/dimension of the vector
long long int64_t
Definition: SR_types.hh:94
unsigned char uint8_t
Definition: SR_types.hh:85
unsigned char uchar
Definition: SR_types.hh:81
unsigned long long uint64_t
Definition: SR_types.hh:94
float float32_t
Definition: SR_types.hh:97
unsigned int uint32_t
Definition: SR_types.hh:90